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.
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!