Question: class Employeef private: string firstName; string lastName; int hourWorked; double Pay Rate; double Salary; public: //1. write separate default and explicit constructors. The memory allocation
class Employeef private: string firstName; string lastName; int hourWorked; double Pay Rate; double Salary; public: //1. write separate default and explicit constructors. The memory allocation for //pointer lastName is done inside the constructor. //2. Write a copy constructor that makes deep copy. //3. Write an assignment operator that makes deep copy and deletes the memory //allocated to the pointer which is being given a new pointee. //4. Write a virtual destructor that de-allocates the memory allocated by //constructors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
