tags:

views:

10

answers:

1

When I work on C currently, I use Xcode and just press Build & Run in the Debugger Console which shows all the program's output.

Example

I want to test iterating through command line arguments now. I tried to fake it with...

int main() {    
    char *argv[] = {"echo","-n","hello world!"};
    int argc = 3;
}

But trying to iterate through argv kept giving me an error...

error: lvalue required as increment operand

When I tried to ++argv.

So, I'm wondering, how can I give some command line arguments to my program when I run it this way, or do I need to compile and then run it with Terminal?

Thanks!

+2  A: 

Go to Project -> Edit Active Executable and add your arguments on the Arguments tab.

Ole Begemann