i was testing with flags in file stream objects the other day
And i did this.
fstream binf("h.txt", ios::app);
binf << "hey";
With fstream since i didnt use ios::out, the output operation shouldnt have worked , but it does work
I noticed that the the output operation works with ios::app only but if i use any other flag without ios::out it doesnt work
Can anyone tell me why I was able to output to the file while using only ios::app without ios::out
Using
appimpliesout.The standard specifies that
appandout|apphave the same result, equivalent to C fopen in mode"a".