#include "stdafx.h"
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//construct an ifstream and bind it to the file named ifile
//ifstream infile(ifile.c_str());
//ofstream output file object to write file named ofile
//ofstream outfile(ofile.c_str());
ifstream iinfile;
ofstream ooutfile;
iinfile.open("in");
ooutfile.open("out");
return 0;
}
本文提供了一个使用C++进行文件输入输出操作的基本示例。通过ifstream和ofstream类展示了如何打开并读写名为'in'和'out'的文件。
327

被折叠的 条评论
为什么被折叠?



