|
|
|
|
|
|
Enhance your address book with the following functionality: 1.) Use friend function to overload the stream insertion '<<' operator, so that you can directly print out the contents of the next person in the address book. You should set this up so that after the last person in the address book is printed, then printing will start over from the beginning. AddressBook ab; cout << ab; //Should print the first person in the book cout << ab; //Should print the second person in the book 2. Overload the '+=' so that a new PERSON can be added to the end of the address book. PERSON p = {"Bob", "Roberts", "123 Anywhere Rd."}; ab+= p; //Adds Bob to the end of the address book 3. Overload the '[]' operator so that a person can directly get at the element of the address book they are searching for. PERSON p; p = ab[3]; // Assigns the 4th person in the addressBook to p |
1.) Use friend function to overload the stream insertion '<<' operator, so that you can directly print out the contents of the next person in the address book. You should set this up so that after the last person in the address book is printed, then printing will start over from the beginning. AddressBook ab; cout << ab; //Should print the first person in the book cout << ab; //Should print the second person in the book |
|
|
|
|
|
|
|
|
|
|
|
|
|
|