Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zorbathut/a6a820b38d53f0c1cb2836870716f962 to your computer and use it in GitHub Desktop.
Save zorbathut/a6a820b38d53f0c1cb2836870716f962 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