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
How to declare an array of pointers to integer?
what is C++ exceptional handling?
Explain the difference between c & c++?
Is java as fast as c++?
How would you obtain segment and offset addresses from a far address of a memory location?
What is a block in c++?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
What are the basic data types used in c++?
Can a program run without main function?
Which is best c++ or java?
What is the difference between while and do while loop?
What are the advantages of using const reference arguments in a function?
What are enumerations?
Explain how to initialize a const data member.
What are the various oops concepts in c++?