Reprompt File Request
My code reads something like
the return type of OpentheFile is a bool. If I return a '1' (TRUE) then the file is opened & stuff is done. However, if I return a '0' (FALSE) - meaning the file was nonexistant, how can I reprompt the user to enter another filename until an existant filename is entered?
cout << "enter filename:";
cin >> filename;
a = OpentheFile(filename, fin);
My loops are messed up..
any help greatly appreciated.
Of course if a is just there to test
- prompt a filename
} while ( ! ( a = OpentheFile(filename, fin) ) );
while ( ! OpentheFile(filename, fin) );
i just figured it out! thanks!