1std::ifstream ifs("foo.txt"); // ifstream: Opens file "foo.txt" for reading only.
2
3std::ofstream ofs("foo.txt"); // ofstream: Opens file "foo.txt" for writing only.
4
5std::fstream iofs("foo.txt"); // fstream: Opens file "foo.txt" for reading and writing.
6