Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct person
- {
- char name[20];
- int age;
- };
- int main()
- {
- person aPerson;
- person *person_ptr;
- person_ptr = & aPerson;
- cout << "Please enter a name: " << endl;
- cin >> person_ptr->name;
- cout << "Please enter an age: " << endl;
- cin >> person_ptr->age;
- cout << person_ptr->name << endl;
- cout << person_ptr->age << endl;
- cout << person_ptr << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement