Works fine until the end. Output is shown in console and then written to a file.
Afterwards the Output-Stream is set back to std and the last line appears in console again.
But when I go back to my Mainmenu system("cls"); doesn't work anymore.
1. My program was written to just output to console. Now I wanted to chage that.
Thought freopen() would be the easiest way as I don't have to rewrite all my outputs to strings.
Isn't there any "quick" solution to write the console-output to a file?
2. That's how it was told by our teacher. Told us there is no prob in using cout / cin instead of printf / scanf. Is that wrong?
If you want to adapt existing program already using cout extensively and do not change any place where it can be found, you can replace cout buffer with homemade one.
A quick example using JLBorges code: http://coliru.stacked-crooked.com/a/ddfb2b7c9d0cde40