Q: What is the proper way to work with files in C++? I'm studying C++, now I'm reading about working with files. As I have read, there is quite a lot of variants. So I wanna ask, what is the right way to work with files in C++? Using fstream(ifstream and ofstream)? I have read some opinions that fopen works much faster, so it is better to use it, but it will be no C++.
Thanks for attention! 

A: Use ifstream and ofstream when working in C++. It should not be much slower than FILE*, but is much safer.
See this related question.

A: I agree with Juraj's assessment of i/ofstream vs. FILE*, I just wanted a word about memory-mapped files.  In Boost.SpiritClassic, there's a lesser-known gem called a mmap_file_iterator:
http://www.boost.org/doc/libs/1_47_0/boost/spirit/home/classic/iterator/file_iterator.hpp
I believe that it will memory-map your file if you're in a windows or POSIX environment, and it is a RandomAccessIterator, rather than a Input/OutputIterator.
As for what method is "proper", it all depends on your application's requirements.  It is definitely good to explore all of your options and compare the results along as many dimensions as you can conceive.
