CS202   3- ‹#›
nstudent::student(const student &s) :
n  checking(s) {                        //call copy ctor
n  school = new char[strlen(s.school) + 1];
n  strcpy(school, s.school);
n  cout <<"student copy constructor called" <<endl;
n}
nstudent::~student() {
n  delete[] school;
n}
nstudent &student::operator=(const student &s) {
n  if (this != &s) {
n    static_cast<checking &>(*this) = s; //call assign op
n    delete[] school;
n    school = new char[strlen(s.school) + 1];
n    strcpy(school, s.school);
n  }
n  cout <<"student assignment op called" <<endl;
n  return(*this);
n}
n
Dyn. Mem - Page 3 of 3