打开文件并写入内容

 

#include <fstream>

using namespace std;

int main()
{
    ofstream os("test.txt");
    os << "Hello World!" << endl;
    os.close();
    return 0;
}

 

posted on 2014-07-01 15:58  deropty  阅读(99)  评论(0)    收藏  举报