void ContactBook::addContact(Contact temp) { Contact* newContact = new Contact(temp); name.addElement(temp.getName(), newContact); ID.addElement(temp.getID(), newContact); phoneNumber.addElement(temp.getNumber(), newContact); bookContacts.push_back(*newContact); ++numberOfContacts; }
//add\remove contacts void ContactBook::addContact() { Contact* temp = new Contact(); temp->enterInfo(); name.addElement(temp->getName(), temp); phoneNumber.addElement(temp->getNumber(), temp); ID.addElement(temp->getID(), temp); bookContacts.push_back(*temp); ++numberOfContacts; }