//tstud.cpp //test driver for Constructors/Destructors example //(default and parameterized constructors) #include "student.h" #include main() { //default constructor used Student freshman; Student *freshman1 = new Student; //constructor with parameters used Student junior("James P. Johnson", 97); Student *senior = new Student("Barbara Simon", 76); cout<<"\t\tConstructors/Destructors example output"<print(); cout<<"\nAfter parameterized constructor:\n"; junior.print(); senior->print(); cout<<"\nNow destructor will be invoked:\n\n"; //invoking destructor for pointer to a class object - //by applying operator 'delete' delete freshman1; delete senior; //destrucor for an automatic class object is invoked //automatically return 0; }