If you intend to open an fstream for output in ios::app mode, do you really need to also specify ios::out as well? For my specific compiler, using just ios::app and not ios::out | ios::app allowed me to output to the file. Doesn't ios::app already assume that you are opening the file for output?
It would depend on if you defined the file stream as a "fstream" or an "ofstream".
For "fstream" you need to tell it if it is for input or output. At least that has been the way I have understood it. I will also say that I have never tried to use just "std::ios::app" when opening an output file stream. I will have to give that a try.
It would help if you would mention your IDE and compiler as there are differences.