Question: (10 pts) Add destructors, copy constructors and assignment operator overloads to the appropriate classes. In Assignment 2, you need to handle dynamic memory in your
(10 pts) Add destructors, copy constructors and assignment operator overloads to the appropriate classes.
In Assignment 2, you need to handle dynamic memory in your classes. Write the big three and test them to make sure they are working.
For example, here are some prototypes for the destructor, copy constructor and assignment operator overload for the Restaurant to get you started.
~Restaurant(); Restaurant(const Restaurant &); Restaurant & operator=(const Restaurant &);
You should test that they are called at the appropriate times. This may be done with print statements in the functions to show it is being called as well as printing the objects before and after the call to show the changes (or not) that occurred.
https://www.chegg.com/homework-help/questions-and-answers/c-lab-3-practice-classes-10-pts-create-h-cpp-files-constructors-accessors-mutators-assignm-q31615114
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
