Q3. Create an address book program that builds on problem #1—this time, the user should be able to not just fill out a single structure, but should be able to add new entries, each with a separate name and phone number. Let the user add as many entries as he or she wants—is this easy to do? It is even possible? Add the ability to display all, or some of the entries, letting the user browse the list of entries.
Q3. Create an address book program that builds on problem #1
What was problem #1?
You need a kind of struct and an array of these structs, like so.
1 2 3 4 5 6 7 8 9 10 11 12
struct Contact
{
string name;
string phone;
};
constint MAX_ELEMS = 100; // choose any number you need
int NumElems; // number of Contacts in the array
Contact PhoneBook[MAX_ELEMS];