Question
4 For which of the following classes do we need to implement the big three, i.e., copy constructor, destructor, and overload assignment operator? Explain briey
4 For which of the following classes do we need to implement the big three, i.e., copy constructor, destructor, and overload assignment operator? Explain briey why. Note that all member variables for the class is listed, but member functions are omitted.
(a) class Student
class Student { // used for student
public:
...
private:
string name;
Date birthday;
};
(b) class AbsenceDates
class AbsenceDates { // used to keep track absence dates for a student...
public:
..
private:
Date * ptrDateArray; // points to an array of Date
int length; // the capacity of array that ptrDateArray points to
};
(c) class HomeworkGrades
class HomeworkGrades
{
public:
...
private:
double grades[10];
int length; //number of grades entered into the array grades
};
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started