Question:Suppose MyClass is a class that defines a copy constructor and overloads the assignment operator. In which of the following cases will the copy constructor of MyClass be called?
A When an object of MyClass is passed by value to a function
B When an object of MyClass is returned by value from a function
C MyClass object1; MyClass object2; object2 = object1;
D MyClass object1; MyClass *object2 = new MyClass(object1);
E MyClass object1; MyClass object2 = object1;
+ AnswerD
+ Report