Quote Originally Posted by blunt View Post
2. C++ is supposed to be simpler than C but I cannot figure it. In C I opened a file with fopen, read it few lines later, close it with fclose, and write it all down with fwrite just before fclose is executed. I just can't figure it out in C++.
C++ will also flush the buffer before you close a file. If you can reproduce a situation where this does not seem to be the case, then post the smallest possible compilable example that demonstrates the problem.