Question: 6 Given the following class definition, write appropriate definitions for the four member functions (outside the class definition): the constructor (must use new to dynamically
6 Given the following class definition, write appropriate definitions for the four member functions (outside the class definition): the constructor (must use new to dynamically allocate memory), destructor to free memory, the functions getName() and getNumber() (you don't need to write the main program). class School public: School (char *nPtr, int a); School(); // sets the member variables to the values given as arguments: char *getName(); int getNumber(); // get the number of students private: char *name; int numberOfStudents
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
