When are copy constructors called in C++?
Answer:
There are some possible situations when copy constructor is called in C++,
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Answer:
There are some possible situations when copy constructor is called in C++,
- When an object of the class is returned by value.
- When an object of the class is passed (to a function) by value as an argument.
- When an object is constructed based on another object of the same class.
- When the compiler generates a temporary object.
need an explanation for this answer? contact us directly to get an explanation for this answer