http://www.cplusplus.com/doc/tutorial/files/Xcode在哪裏創建.txt文件?
我剛剛完成執行此操作,但我沒有在我的桌面上得到任何文件。
那麼.txt文件放在我的電腦上?
// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
出於興趣,你爲什麼期望它在你的桌面上? –
從您的個人資料 - '我癡迷於隨時保持高效'。那麼,我的答案是否解決了你的問題? –