i posted this problem in C++ forum and people told me its impossible.
I'm using a very old version of C++ and most of its features are very similar to C.
So i thought maybe you people will understand what the problem is....
In the following code, getch() is executed before the file is displayed.
void ReadFile()
{ char fname[13],ch;
cout<<"Enter filename : ";
cin>>fname;
strcat(fname,".mth");
temp.open(fname,ios::in|ios::nocreate);
if(!temp)
{ cout<<"File does not exist!!!";
getch(); return;
}
temp.get(ch);
while(!temp.eof())
{ cout.put(ch);
temp.get(ch);
} temp.close();
getch();
}
you can find the thread i've posted in C++ forum at
http://www.daniweb.com/forums/thread103115.html
i've posted there the exe file i got after compiling the program containing this function and how to get this error un that program.