-
Filepointer
WHAT IS FILE POINTER USED FOR??
char * FileName = "input.dat";
inFile.open(FileName);
if(!inFile)
{
cout<<"Sorry cannot open file"
exit(0);
}
why is this unacceptable
ifstream readme;
char ch;
char newch;
readme.open("output.dat");
if (!readme) {
//Unable to open file for output( eg, readonly, no disk space)
cerr<<"Unable to open file\n";
exit(0);
-
Do the files you are trying to read exist? Hint: use code tags.
-
I dont really see whats unaccpetable here...
-
I think I know the problem. You use ofstream to write a file not ifstream.
-
What do you mean by unacceptable, are you having a compiler error, or runtime error or what?