I run this is OK, "d.txt" is created and "12" is appended.
But like this, there will be no effect.Code:#include <fstream.h>
int main(){
fstream file;
file.open( "d.txt", ios::app );
file.write( "12" ,2 );
file.close();
return 0;
}
why? How to do if I must to write in the second form??Code:#include <fstream>
using namespace std;
int main(){
fstream file;
file.open( "d.txt", ios::app );
file.write( "12" ,2 );
file.close();
return 0;
}
thx.