#include <string>
#include <fstream>
int main()
{
using namespace std;
ifstream file1;
char str[100];
string str1;
file1.open("abc.txt");
while (!file1.eof())
{
file1.getline(str,100);
getline(file1,str1);
cout << str;
}
ofstream file;
file.open("example.txt"); //或者构造函数直接ofstream file("example.txt");
file << "shit";
file.close();
return 0;
}