int main(void) { PhoneBook *pbook = new PhoneBook(FILETYPE); Contact *c = new Contact("rakesh","sadhu","9686862367","9966680427"); pbook->addContact(c); QVector<Contact *>*list = pbook->findContacts("rakesh"); Contact *o; int i=-1; while(++i<list->size()) { o = list->at(i); qDebug()<<"\nname :: "<<o->fname<<"\nsurname ::"<<o->lname<<"\nmob:: "<<o->mob<<"\n tele"<<o->landline<<endl; } delete pbook; return 0; }
int main(void) { bool end = false; PhoneBook PhoneBook; std::string str; while (end == false) { std::cout << "What do you want? (ADD, SEARCH, EXIT) : "; std::getline(std::cin, str); str_toupper(&str); if (str.compare("ADD") == 0) PhoneBook.addContact(); else if (str.compare("SEARCH") == 0) PhoneBook.search(); else if (str.compare("EXIT") == 0) end = true; else std::cout << "[" << str << "]" << " is invalid input." << std::endl; } return (0); }