程序中常用语句:
#include<fstream>
#include<iostream>
#include<string>
using namespace std;
ifstream fin;
fin.open(filename);
ofstream fout;
fout.open(filename);
if(fin.is_open()){
cout<<"Open file success!"<<endl;
}
while(!fin.eof()){
string str;
getline(cin,str);
fout<<str;
}
fin.close();
fout.close();