Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Giving Command line arguments in Xcode in C program

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:

./a.out myfirstCommand mySecondCommand 

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

like image 946
itsaboutcode Avatar asked Nov 09 '09 02:11

itsaboutcode


People also ask

How do I pass a command line argument to a program?

If you want to pass command line arguments then you will have to define the main() function with two arguments. The first argument defines the number of command line arguments and the second argument is the list of command line arguments.


2 Answers

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.

like image 140
jengelsma Avatar answered Sep 30 '22 05:09

jengelsma


Keyboard shortcut is commandshift<

like image 43
Steve Yost Avatar answered Sep 30 '22 06:09

Steve Yost