首页 > 代码库 > c++对文件操作的支持

c++对文件操作的支持

#include <stdio.h>#include <iostream>#include <fstream>using namespace std;void main(){           int a,b;    char c;    ofstream fout("test.txt");    fout<<" "<<0<<" "<<1<<" "<<4<<endl;    fout<<" "<<3<<" "<<4<<" "<<d<<endl;    ifstream fin("test.txt");    while (!fin.eof())    {        fin>>a>>b>>c;        cout<<a<<" "<<b<<" "<<c<<endl;    }    cin>>a;}

 http://www.cplusplus.com/doc/tutorial/files/

c++对文件操作的支持