且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用相对路径使用Xcode在C中打开文件?

更新时间:2023-11-10 13:01:28

选项1:安装命令行工具.将C文件和文本文件放在同一目录中.打开一个终端窗口.从命令行编译并运行.如果我没记错的话,可以在 Preferences .../Downloads 中找到命令行工具下载.

Option 1: Install the command line tools. Put the C file and the text file in the same directory. Open a terminal window. Compile and run from the command line. If I recall correctly, the command line tools download can be found in Preferences.../Downloads.

选项2:转到 Product/Scheme/Edit Scheme ... 菜单.出现对话框时,在左侧选择 Run ,在顶部选择 Options .然后查找工作目录.将工作目录设置为指向文本文件所在的目录.

Option 2: Go to the Product/Scheme/Edit Scheme... menu. When the dialog box appears, select Run at the left and Options at the top. Then look for Working Directory. Set the working directory to point to the directory where the text file is.