Click here to Skip to main content
15,912,932 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Event Handler For Dynamic Context Menu Pin
Hans Dietrich22-Jun-07 23:28
mentorHans Dietrich22-Jun-07 23:28 
AnswerRe: Event Handler For Dynamic Context Menu Pin
Iain Clarke, Warrior Programmer23-Jun-07 1:37
Iain Clarke, Warrior Programmer23-Jun-07 1:37 
QuestionProblems Pin
mikobi22-Jun-07 21:29
mikobi22-Jun-07 21:29 
AnswerRe: Problems Pin
Y_Kaushik22-Jun-07 21:35
Y_Kaushik22-Jun-07 21:35 
AnswerRe: Problems Pin
Hamid_RT22-Jun-07 22:21
Hamid_RT22-Jun-07 22:21 
GeneralRe: Problems Pin
mikobi22-Jun-07 22:55
mikobi22-Jun-07 22:55 
GeneralRe: Problems Pin
Hamid_RT23-Jun-07 1:35
Hamid_RT23-Jun-07 1:35 
QuestionInfinite While Loop! Pin
EngMohab22-Jun-07 21:26
EngMohab22-Jun-07 21:26 
I have a linked list that stores strings and there locations, I should save this list to a file and then load it from the same file, I wrote the following functions :

////Save list to a File

void list::store()
{
ofstream write;

write.open("d:\\info.txt");
if(write==NULL)
{
cout<<"Error opening File"<<endl;
return;
="" }
="" node*="" ptr="head;

" while(ptr)
="" {
="" write<<ptr-="">data<<" ";
write<<ptr->location<<" ";
ptr=ptr->next;
}
write.close();
}





////Load list to a File

void list::load()
{

string tempname,templocation;
ifstream read;

read.open("d:\\info.txt");
if(read==NULL)
{
cout<<"Error opening File"<<endl;
return;
="" }

="" while(!read.eof())
="" {
="" read="">>tempname>>templocation;
insert(tempname,templocation);
}
read.close();
}

the store function works properly, my problem is in the load function, when I run it, it fails to detect the end of file "info", so the while loop becomes infinite. how can I make it detect the end of the file ?
AnswerRe: Infinite While Loop! Pin
Mark Salsbery23-Jun-07 8:11
Mark Salsbery23-Jun-07 8:11 
QuestionProgress control in list view Pin
neha.agarwal2722-Jun-07 21:23
neha.agarwal2722-Jun-07 21:23 
QuestionWindows Blinds... Pin
Polite Programmer22-Jun-07 21:09
Polite Programmer22-Jun-07 21:09 
Questiondestructor Pin
deeps_cute22-Jun-07 20:59
deeps_cute22-Jun-07 20:59 
AnswerRe: destructor Pin
Mark Salsbery23-Jun-07 8:24
Mark Salsbery23-Jun-07 8:24 
Questionprint problem Pin
Y_Kaushik22-Jun-07 20:43
Y_Kaushik22-Jun-07 20:43 
AnswerRe: print problem Pin
MANISH RASTOGI22-Jun-07 21:58
MANISH RASTOGI22-Jun-07 21:58 
GeneralRe: print problem Pin
Y_Kaushik22-Jun-07 22:09
Y_Kaushik22-Jun-07 22:09 
QuestionInstaller created shortcut Pin
rp_suman22-Jun-07 16:41
rp_suman22-Jun-07 16:41 
QuestionQueryPerformanceCounter - unreliable timing on win32 but perfect on x64 [modified] Pin
Cyrilix22-Jun-07 16:34
Cyrilix22-Jun-07 16:34 
QuestionHow to share a class between different projects in VC++? Pin
Skywalker200822-Jun-07 11:34
Skywalker200822-Jun-07 11:34 
AnswerRe: How to share a class between different projects in VC++? Pin
Hans Dietrich22-Jun-07 12:10
mentorHans Dietrich22-Jun-07 12:10 
GeneralRe: How to share a class between different projects in VC++? Pin
Cyrilix22-Jun-07 12:32
Cyrilix22-Jun-07 12:32 
GeneralRe: How to share a class between different projects in VC++? Pin
Mark Salsbery22-Jun-07 12:50
Mark Salsbery22-Jun-07 12:50 
GeneralRe: How to share a class between different projects in VC++? Pin
Cyrilix22-Jun-07 14:00
Cyrilix22-Jun-07 14:00 
GeneralRe: How to share a class between different projects in VC++? Pin
Mark Salsbery22-Jun-07 14:06
Mark Salsbery22-Jun-07 14:06 
GeneralRe: How to share a class between different projects in VC++? Pin
Skywalker200825-Jun-07 2:50
Skywalker200825-Jun-07 2:50 

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.