Hello!
I have the following simple code:
-------------------------------------------
#include
#include
int main()
{
fstream w;
w.open("file",ios::app);
if ( w.fail() ) {
cout << "Failure!" << endl;
} else {
cout << "Success!" << endl;
w << "Write in the file." << endl;
w.close();
}
}
-------------------------------------------
When I compile it using Intel C++ compiler
and run it after that I have the following
result:
$ icpc stream.C -o istream
$ istream
Failure!
$ cat file
cat: file: No such file or directory
When I compile it using g++ compiler
and run it after that I have the following
result:
$ g++ stream.C -o gstream
$ gstream
Success!
$ cat file
Write in the file.
Any ideas? What could be wrong?
Thanks.
_Gancho.
fstream and ios::app
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.


