#include
#include
#include
using namespace std;
int main()
{
ofstream outdata;
outdata.open("bool.txt",ios::app);//ios::app是尾部追加的意思
outdata<<"其实我没有测试过。。。"<outdata.close();
return 0;
}
ofstream file;
file.open( "a.txt", ios::out );
string str = "dddddddddddddddfbbbbbbbbb";
if ( file.is_open() )
{
file << str << endl;
}
file.close();
方法很多!