📜  文件 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:45.371000             🧑  作者: Mango

代码示例4
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.