#include "student.h" /* A short main function to test the Student class. */ int main() { //create a student object Student s("Jane Doe", 1234); //print the contents of s s.print(); //change the information stored in s s.setName("Silly Sally"); s.setID(9876); //print s again //output should reflect the changes s.print(); //dynamically create a student object //and print it Student *s_ptr = new Student("Bob Smith", 5677); s_ptr->print(); //delete the dynamically declared //student -- destructor works! delete s_ptr; //test the copy constructor of Student Student s_cpy = s; s_cpy.print(); //change the name of s and print //the copy of s again //the copy should NOT reflect the changes //to s -- copy constructor works and does //a deep copy! s.setName("Sassy Sally"); s_cpy.print(); //create another copy to test the //copy assignment operator Student s2_cpy("Fred Frog", 3434); s2_cpy = s; s.setName("Smelly Sally"); s2_cpy.print(); return EXIT_SUCCESS; } /* ***Program Output*** Name: Jane Doe ID: 1234 Name: Silly Sally ID: 9876 Name: Bob Smith ID: 5677 Name: Silly Sally ID: 9876 Name: Silly Sally ID: 9876 Name: Sassy Sally ID: 3434 Press any key to continue */