Hey guys I am using code that does the following:
cin.ignore();
cin.getline(file, 250);
ifstream test;
test.open (file);
if (test.fail())
{
cout<<"error"<<endl;
exit(1);
}
...
The problem is that if a file name is entered that does not exist for example c:\\fred.txt the error message will not appear and the txt file fread will be created, but if I enter "c:\\fred.txt" the code seems to work, but I have created similar code before using cin.getline and the quotes were not needed. Any ideas what I have done wrong?
Thanks.