C++ Interview Questions
Questions Answers Views Company eMail

What is Copy Constructor?

ABC, Siemens,

5 9404

What is an abstract class?

Siemens,

3 4596

What is the difference between creating an object, using 'new' and using 'malloc'?

Siemens, HFG,

2 6021




What is a virtual base class?

Siemens,

6 14264

What is OOPS and How it is different from Procedural Programming ?

Infosys, HP, Thyrocare,

23 48824

Difference between Top down and bottom up approaches for a given project ?

Siemens, Infosys, HCL, CSC, HP, IIT, BSNL,

14 86954

What and all can a compiler provides by default?

Accenture, HP,

3 7917

What are the different operators in C++?

HP,

3 9836

What is the difference between method and message?

HP,

4 29616

What is difference between initialization and assignment?

Infosys, HCL, HP,

12 38529

when can we use copy constructor?

HP,

6 11210

Describe functional overloading?

HP,

6 6678

Difference between Overloading and Overriding?

IBM, NIIT, GameLoft, HP, Appnetix Techno, Rohde and Schwarz,

35 168913

Difference between Operator overloading and Functional overloading?

HP,

10 39696

What is virtual constructor paradigm?

HCL, HP,

5 7962







Un-Answered Questions { C++ }

Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

598


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

5158


can any one help to find a specific string between html tags which is changed to a sting.. weather.html looks (for location) is somewhere #include #include #include using namespace std; string find_field(string myPage,string); int main (void) { string page, line, location, temperature; ifstream inputFile("weather.xml"); while(getline(inputFile, line)) { page.append(line); line.erase(); } // Now page is a string that contains the whole xml page // Here you need to write something that finds and // extracts location and temperature from the XML // data in the string page and stores them in // the strings location and temperature respectively location=find_field(page,"location"); temperature=find_field(page,"temp_c"); cout << "Location: "<

590


In what scenario does the Logical file and Physical file being used?

1221


How to call a non virtual function in the derived class by using base class pointer

2885


Prepare me a program for the animation of train

988


what type of questions

757


write a C++ program for booking using constructor and destructor.

1015


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

453


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

2033


what is difference between class template and template class?

1143


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

1327


what are the ways in which a constructors can be called?

591


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

4578


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

1874