Check out example codes for "apertura file in c++". It will help you in understanding the concepts better.

Code Example 1

std::ifstream ifs("foo.txt");  // ifstream: Opens file "foo.txt" for reading only.

std::ofstream ofs("foo.txt");  // ofstream: Opens file "foo.txt" for writing only.

std::fstream iofs("foo.txt");  // fstream:  Opens file "foo.txt" for reading and writing.

Learn ReactJs, React Native from akashmittal.com