int main () { Student *p = new Student (16, 10); p->about_me (); // prints "I am a student." cout << "id: " << p->get_id () << "\n"; delete p; // Important! Make sure to delete the allocated memory return 0; }
int main () { Student *p = new Student (16, 10); p->about_me (); // prints "I am a student." cout << "id: " << p->get_id () << "\n"; p->set_course (11); cout << "Passed the class. Now at grade " << p->get_course() << "\n"; delete p; // Important! Make sure to delete the allocated memory return 0; }