本來只覺得自己是個大菜, 沒想到學計算機4年的室友也不會將程序內容寫入到文本。 多動手纔是關鍵,學了不用還是什麼都不知道!!!
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
ofstream ouTT; //流名稱
ouTT.open("d:\\test.txt"); //流寫入位置
ouTT<<"A C E"<<endl; //流輸出內容,用法和COUT一樣
ouTT.close();
}