Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Sample Technical Questions

C++ and OOPS Sample Question

  1. Determine the output of the 'C++' Codelet.
    class base
    	{  
    	public : 
    		out() 
    		{ 
    			cout«"base ";  
    		}  
    	};
    	class deri{ 
    	public : out() 
    	{ 
    	cout«"deri "; 
    	}   
    	};
    	void main()
    	{ 	deri dp[3];
    		base *bp = (base*)dp;
    		for (int i=0; i<3;i++)
    		(bp++)->out();
    	}

  2. Justify the use of virtual constructors and destructors in C++.
  3. Each C++ object possesses the 4 member fns,(which can be declared by the programmer explicitly or by the implementation if they are not available). What are those 4 functions?
  4. What is wrong with this class declaration?
    class something
    	{
    		char *str;
    		public:
    		   something(){
    		   st = new char[10]; }
    		  ~something()
    		  {
    	   		delete str; 
    		  }
    	 };
  5. Inheritance is also known as -------- relationship. Containership as ________ relationship.
  6. When is it necessary to use member-wise initialization list (also known as header initialization list) in C++?
  7. Which is the only operator in C++ which can be overloaded but NOT inherited.
  8. Is there anything wrong with this C++ class declaration?
    class temp
    	{
    	  int value1; 
    	  mutable int value2;
    	  public :
    	  	void fun(int val) 
    		const{
    	  	((temp*) this)->value1 = 10;
    	  	value2 = 10;
    	  	}
    	 };

« Previous || Next »

C++ Sample Question number : 1-3 | 4-7 | 8-10 | 11-13 | 14-21 | 22-28 | 29-35 | 36-42 | 43-49 | 50-54 | 55-58 | 59-66 | 67-73 | 74-80
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.