- 论坛徽章:
- 0
|
打开一个已存在文件,用可读写,追加的方式,怎么会出错呢
ps:在linux,gcc环境下
代码如下
#include<fstream>
#include<iostream>
using namespace std;
typedef fstream fd;
int main()
{
fstream fd1;
fd1.open("test.txt",fstream::in|fstream::out|fstream::app);
if( fd1.fail())
cout<<"!!";
fd1.close();
return 0;
} |
[ 本帖最后由 cc007cc 于 2008-10-13 16:18 编辑 ] |
|