c++ - Xcode 在哪里创建 .txt 文件?

标签 c++ file location

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;
}

最佳答案

该死的...我已经看到这个帖子很多次都没有回复过..

这是解决方案

当您在当前项目中工作时,在您的项目导航器中有很多文件。试用产品(如果我记得的话)并查找可执行文件。现在转到属性检查器或任何所谓的。 (Xcode 的右侧。)

你会在某处找到一个名为 PATH 的部分,那里写着路径。它是可执行文件运行的路径。这意味着您可以在其中找到您使用程序创建的所有文件。

试一试...这就是我管理和查看我的 .txt 文件的方式,因为有时我想给它们某种格式。

希望我已经解决了您的问题...干杯! ;)

关于c++ - Xcode 在哪里创建 .txt 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13215910/

相关文章:

c++ - 检测 CreateProcess 或进程的创建者

c++ - Q : Template class that takes either a normal type or a template template argument

c++ - 以编程方式生成可以导入 blender 的 3D 模型

map - jQuery/谷歌地图 : Location picker with radius control?

c++ - 不同步读写SysV共享内存(使用信号量,C/C++,Linux)

Python 代码输出到文件并在文件名中添加时间戳

python - 迭代配置文件中的部分

windows - 我目前在 Linux 中使用 SVN。如何从 Windows 桌面添加文件?

ios - 如何检查一个节点的位置是否包含在另一个节点中?

algorithm - 表示位置和基于接近度查询的有效方法?