Forked from anonymous/gist:f48103ef478908d59cbbc853ae9d1d96
Created
April 28, 2017 11:35
-
-
Save zorbathut/a6a820b38d53f0c1cb2836870716f962 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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