在C程序中的Xcode中给出命令行参数

时间:2022-09-06 14:09:34

I am solving my C assignment in Xcode and in that program i have to give command line arguments when running the program and for this i have to user terminal like this:

我在Xcode中解决我的C赋值,在该程序中我必须在运行程序时给出命令行参数,为此我必须像这样的用户终端:

./a.out myfirstCommand mySecondCommand

I was wondering if it possible to give these kind of commands within xcode instead of going to terminal. Thanks

我想知道是否有可能在xcode中提供这些命令而不是去终端。谢谢

4 个解决方案

#1


12  

Right click the executable in your Xcode project and pick "Get Info". Then pick the "arguments" tab and you can set arguments to pass when you run or debug your program from inside Xcode.

右键单击Xco​​de项目中的可执行文件,然后选择“获取信息”。然后选择“参数”选项卡,您可以设置在Xcode内部运行或调试程序时要传递的参数。

#2


113  

As of Xcode 4.x I've had to go to the Product menu, select "Edit Scheme", then select the arguments tab and add the arguments there.

从Xcode 4.x开始,我必须进入产品菜单,选择“编辑方案”,然后选择参数选项卡并在那里添加参数。

#3


20  

Keyboard shortcut is commandshift<

键盘快捷键是commandshift <

#4


5  

In Xcode 8.x just select the project from the title bar and select Edit Schema, then select the Run debug and select the Arguments Tab from the popup window.

在Xcode 8.x中,只需从标题栏中选择项目并选择Edit Schema,然后选择Run debug并从弹出窗口中选择Arguments选项卡。

在C程序中的Xcode中给出命令行参数

在C程序中的Xcode中给出命令行参数

#1


12  

Right click the executable in your Xcode project and pick "Get Info". Then pick the "arguments" tab and you can set arguments to pass when you run or debug your program from inside Xcode.

右键单击Xco​​de项目中的可执行文件,然后选择“获取信息”。然后选择“参数”选项卡,您可以设置在Xcode内部运行或调试程序时要传递的参数。

#2


113  

As of Xcode 4.x I've had to go to the Product menu, select "Edit Scheme", then select the arguments tab and add the arguments there.

从Xcode 4.x开始,我必须进入产品菜单,选择“编辑方案”,然后选择参数选项卡并在那里添加参数。

#3


20  

Keyboard shortcut is commandshift<

键盘快捷键是commandshift <

#4


5  

In Xcode 8.x just select the project from the title bar and select Edit Schema, then select the Run debug and select the Arguments Tab from the popup window.

在Xcode 8.x中,只需从标题栏中选择项目并选择Edit Schema,然后选择Run debug并从弹出窗口中选择Arguments选项卡。

在C程序中的Xcode中给出命令行参数

在C程序中的Xcode中给出命令行参数