fstream file("b.txt", fstream::in|fstream::out|fstream::app);
ate 并不会导致create属性,
app可造成out属性
in 表示只读属性
out表可写属性+create shuxing
in+out 表只读+可写属性(没有创建属性)
dd.out.txt:
s
{
cout<<"---------------------------------------\n";
fstream file("dd.out.txt", fstream::out); // make dd.out.txt empty
//fstream file("dd.out.txt", fstream::out|fstream::in);
string s;
file>>s;
cout<<s;
file.close();
}