2

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!

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.