Skip to content

Instantly share code, notes, and snippets.

Created April 28, 2017 11:27
Show Gist options
  • Save anonymous/f48103ef478908d59cbbc853ae9d1d96 to your computer and use it in GitHub Desktop.
Save anonymous/f48103ef478908d59cbbc853ae9d1d96 to your computer and use it in GitHub Desktop.
Class University
void addPerson() {
Student s;
People *p;
*p = &s;
p->createPerson();
vectorPeople.push_back_(p)
}
void printPeople() {
vectorPeople[0]->printPerson();
Class People
void createPerson() {
cin >> name;
cin >> age;
}
void printPerson() {
cout << name << endl;
cout << age << endl;
Class Student: public People {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment