When do you call copy constructors?
Page 1 of 1
When do you call copy constructors?
Copy constructors are called in these situations:
i.)when compiler generates a temporary object
ii.)when a function returns an object of that class by value
iii.)when the object of that class is passed by value as an argument to a function
iv.)when you construct an object based on another object of the same class
Similar topics
» What is virtual constructors/destructors?
» What are the restrictions apply to constructors and destructors?
» Explain how to call C functions from C++ ??
» What is copy constructor?
» What is copy constructor?
» What are the restrictions apply to constructors and destructors?
» Explain how to call C functions from C++ ??
» What is copy constructor?
» What is copy constructor?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|