Пример #1
0
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;
}
Пример #2
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;
}