#include "Person.h" #include #include #include #include //#include // include headers that implement an archive in simple text format //#include //#include // include header that allows serialization of STL list //#include // STL collection of Person* std::list people; void add() { // creates a person, collects the information, adds person to list Person *newP = new Person; newP->askForInfo(); people.push_back(newP); } void showPerson(Person *p) { // displays a person p->display(); } void display() { // displays all the people std::for_each(people.begin(), people.end(), &showPerson); } int main() { char choice = 0; while (choice != 'X') { switch (choice) { case 'A': add(); break; case 'D': display(); break; } std::cout << "Enter choice: [A]dd, [D]isplay, e[X]it: "; std::cin >> choice; choice = std::toupper(choice); } return 0; }