/* * File: addressBook.h * Purpose: Class definition for an address book class. */ #ifndef ADDRESSBOOK_H #define ADDRESSBOOK_H #include #include #include "contact.h" #define MAXCONTACTS 5 class AddressBook { public: //add and delete return true on success false on failure bool addContact(Contact &c); bool deleteContact(std::string name); //returns the index of the contact, -1 on failure int search(std::string name); //returns the number of items in the contact int getCount(); //returns a reference to the contact at position i Contact &at(int i); private: Contact contacts[MAXCONTACTS]; //list of contacts int count; //number of contacts }; #endif