Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalusing ifstream to read a file. Pin
Hachaso21-Jun-05 2:12
Hachaso21-Jun-05 2:12 
GeneralRe: using ifstream to read a file. Pin
xiaohe52121-Jun-05 3:17
xiaohe52121-Jun-05 3:17 
GeneralRe: using ifstream to read a file. Pin
Hachaso21-Jun-05 3:32
Hachaso21-Jun-05 3:32 
GeneralRe: using ifstream to read a file. Pin
S. Senthil Kumar21-Jun-05 3:34
S. Senthil Kumar21-Jun-05 3:34 
GeneralSave & Open Pin
suroor45321-Jun-05 1:52
suroor45321-Jun-05 1:52 
GeneralRe: Save & Open Pin
ThatsAlok21-Jun-05 2:14
ThatsAlok21-Jun-05 2:14 
GeneralRe: Save & Open Pin
xiaohe52121-Jun-05 3:12
xiaohe52121-Jun-05 3:12 
GeneralRe: Save & Open Pin
suroor45322-Jun-05 3:04
suroor45322-Jun-05 3:04 
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 <list.h>typedef CList<phonebookentry *,="" phonebookentry="" *="">
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;
}
//**********************************************
GeneralCrash when using EditSecurity function Pin
Sudhir Mangla21-Jun-05 1:33
professionalSudhir Mangla21-Jun-05 1:33 
GeneralDebugging Internet Explorer Pin
munawar196821-Jun-05 0:58
munawar196821-Jun-05 0:58 
GeneralRe: Debugging Internet Explorer Pin
BlackDice21-Jun-05 6:25
BlackDice21-Jun-05 6:25 
GeneralCaps Lock Indicator Problem ! Pin
AbinThomas21-Jun-05 0:41
AbinThomas21-Jun-05 0:41 
GeneralRe: Caps Lock Indicator Problem ! Pin
Cool Ju21-Jun-05 2:22
Cool Ju21-Jun-05 2:22 
GeneralDetecting media present in a CD drive Pin
fainley20-Jun-05 23:10
fainley20-Jun-05 23:10 
GeneralRe: Detecting media present in a CD drive Pin
Bob Stanneveld20-Jun-05 23:34
Bob Stanneveld20-Jun-05 23:34 
GeneralRe: Detecting media present in a CD drive Pin
Cedric Moonen20-Jun-05 23:42
Cedric Moonen20-Jun-05 23:42 
GeneralRe: Detecting media present in a CD drive Pin
Bob Stanneveld20-Jun-05 23:45
Bob Stanneveld20-Jun-05 23:45 
GeneralRe: Detecting media present in a CD drive Pin
ThatsAlok20-Jun-05 23:58
ThatsAlok20-Jun-05 23:58 
GeneralRe: Detecting media present in a CD drive Pin
ThatsAlok20-Jun-05 23:39
ThatsAlok20-Jun-05 23:39 
GeneralRe: Detecting media present in a CD drive Pin
GDavy21-Jun-05 0:48
GDavy21-Jun-05 0:48 
GeneralRe: Detecting media present in a CD drive Pin
David Crow21-Jun-05 4:41
David Crow21-Jun-05 4:41 
GeneralRe: Detecting media present in a CD drive Pin
Blake Miller21-Jun-05 5:54
Blake Miller21-Jun-05 5:54 
GeneralCstring instance declared, but "not found" while debugging *IMAGE Pin
hanhao20-Jun-05 22:28
hanhao20-Jun-05 22:28 
GeneralRe: Cstring instance declared, but &quot;not found&quot; while debugging *IMAGE Pin
Colin Angus Mackay20-Jun-05 22:43
Colin Angus Mackay20-Jun-05 22:43 
GeneralRe: Cstring instance declared, but "not found" while debugging *IMAGE Pin
Vikram A Punathambekar20-Jun-05 22:51
Vikram A Punathambekar20-Jun-05 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.