Now the problem has to do with the combination of the variable "analytical" and the opening of the file. If I just run the program writing output on the standard output, and not open the file, everything is fine and if I comment out the variable analytical and write something random onto myfile, it also works. But when I include "analytical" and open the file, the program fails.
Does anybody have an idea why this might be the case and what is happening here? I don't know too much about reading/writing on files, I just read the tutorial on this site.
what do you mean by the program fails ? what do you expect to be printed on the file and in std output, do they differ ? if that is the case, try adding: myfile.unsetf( ios::floatfield ); and myfile.precision( 12 ); to myfile stream also