Answer Posted / namitha
A copy constructor is used in the following cases.
-When an object is created from another object of the same
type.
-When an object is passed by value as a parameter to a
function.
-When an object is returned from a pointer.
-when we want to set a default value for the data members.
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
Tell me an example where stacks are useful?
Why cstdlib is used in c++?
What is overloading unary operator?
Difference between inline functions and macros?
What's the hardest coding language?
What is singleton pattern in c++?
What are function prototypes?
Difference between an inspector and a mutator
What are the advantages of pointers?
What is boyce codd normal form in c++?
What is pair in c++?
Explain terminate() function?
What is isdigit c++?
Do you know the problem with overriding functions?