C++ Interview Questions
Questions Answers Views Company eMail

What is Copy Constructor?

ABC, Siemens,

5 13061

What is an abstract class?

Siemens,

4 6589

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

Siemens, HFG,

3 7965




What is a virtual base class?

Siemens,

6 17905

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

Infosys, HP, Thyrocare,

23 53655

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

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

14 95598

What and all can a compiler provides by default?

Accenture, HP,

3 10690

What are the different operators in C++?

HP,

3 10989

What is the difference between method and message?

HP,

4 40106

What is difference between initialization and assignment?

Infosys, HCL, HP,

12 46544

when can we use copy constructor?

HP,

6 12297

Describe functional overloading?

HP,

6 7777

Difference between Overloading and Overriding?

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

35 178755

Difference between Operator overloading and Functional overloading?

HP,

10 44108

What is virtual constructor paradigm?

HCL, HP,

5 9906







Un-Answered Questions { C++ }

officer say me - i am offered to a smoking , then what can you say

895


why and when we can declar member fuction as a private in the class?

959


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

1173


Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation

964


draw a flowchart that accepts two numbers and checks if the first is divisible by the second.

1460






Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

838


how to get the oracle certification? send me the answer

932


How to use CMutex, CSemaphore in VC++ MFC

3507


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

2353


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1319


what type of question are asked in thoughtworks pair programming round ?

636


write a program to convert a decimal number in to its equivalent binary number?

1334


what are the iterator and generic algorithms.

842


How Do you Code Composition and Aggregation in C++ ?

22073


A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

2329