Save & Open
-
i made a linked list of nodes...! but i need to save my list of nodes on hard disk... and i need to load this list when i open my program... (it is a phonebook program in console application)
suroor_bio wrote: it is a phonebook program in console application) Where exactly are you facing problem buddy :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
i made a linked list of nodes...! but i need to save my list of nodes on hard disk... and i need to load this list when i open my program... (it is a phonebook program in console application)
-
class Photo { std::string sName; std::string sPhoneNo; } class Photos { public: Photos(std::string sFileName) { //readFromFile } bool SaveToFile(std::string sFileName); private: list lstPhoto; } I love Programming
I want to save the entry details on the hard disk after entering it then when I open the programe again I want the details to be entered to the list again I APPROCIATE ANY HELP #include #include typedef CList PhoneBook; struct PhoneBookEntry { CString Name,phone; }; //***********************main************ switch (nChoice) { case 1: // add entry PhoneBookEntry *pEntry; pEntry = InputEntry(); g_PhoneBook.AddTail(pEntry); break; case 2: //list entries pos = g_PhoneBook.GetHeadPosition(); while (pos) { PhoneBookEntry* pEntry = g_PhoneBook.GetNext(pos); PrintEntry(pEntry); } } //*********************************** PhoneBookEntry* InputEntry() //func. to enter details { PhoneBookEntry* pEntry = new PhoneBookEntry; cout << "Enter new entry details:" << endl; cout << " Name: "; char cName[100]; gets(cName); cout << " Phone: "; char cOfPhone[100]; gets(cOfPhone); pEntry->Name = cName; pEntry->Phone = cOfPhone; return pEntry; } //**********************************************