【发布时间】:2012-11-04 03:51:29
【问题描述】:
http://www.cplusplus.com/doc/tutorial/files/
我刚刚完成了这个,但我的桌面上没有任何文件。
那么 .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;
}
【问题讨论】:
-
出于兴趣,您为什么希望它出现在您的桌面上?
-
来自您的个人资料 -
I am obsessed with being super efficient at all times。那么,我的回答解决了你的问题吗?