If obj1 and obj2 are both objects of a class that uses dynamic memory allocation, but the class does not have an assignment operator, what happens if you execute the following code?
Obj1=obj2;
A) A syntax error occurs, you can not assign one object to another object without the = operator
B) A run-time error occurs, because the C++ system does not know how to do the assignment.
C) The pointers) to the dynamically declared memory in obj2 are copied to the corresponding pointers in obj1.
D) There is a complete and independent copy of all the dynamic memory from obj2 to obj1
Correct Answer:
Verified
Q41: What member functions do you need to
Q42: Given the following function declaration,
Friend void displayconst
Q43: The destructor for a class is called
A)
Q44: Which of the following statements are true?
A)
Q45: In an overloaded insertion or extraction operator,
Q47: Which of the following are not correct?
A)
Q48: Which of the following statements are true?
A)
Q49: Which of the following are valid declarations
Q50: The copy constructor for a class is
Q51: Which of the following operators can not
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents