Oh, another quick question:
Any ideas why I keep getting stuck in this loop ?
Code:
ifstream a_file (location.c_str());
a_file>> content;
if ( a_file.fail() )
{
mb_result = MessageBox(NULL, " Failed to locate/read a file.\n Do you wish to try again ? ", " Text.exe", MB_YESNO | MB_ICONEXCLAMATION);
while ( mb_result == IDYES && a_file.fail() )
{
system("cls");
cout<<"\n TXT READER\n\n\n NOTE: This program is used for reading\n txt documents only.\n\n\n";
cout<<" Text file you wish to read:\n\n ";
getline (cin, location);
ifstream a_file (location.c_str());
a_file>> content;
}
}
Cheers