not sure how to seperate them on the command line? i thought using quotes but doesn't work?
Printable View
not sure how to seperate them on the command line? i thought using quotes but doesn't work?
by whitespace :D
Doesn't work how? Of course it works, depending on your shell of course.
Code:zac@neux:~ (0) $ cat args.c
#include <stdio.h>
int main(int argc, char * argv[])
{
int i = 0;
for(i = 0; i < argc; i++)
{
printf("Argument %d: %s\n", i, argv[i]);
}
return 0;
}
zac@neux:~ (0) $ gcc args.c -o args
zac@neux:~ (0) $ ./args "this is the first 'argument'" "and then the second"
Argument 0: ./args
Argument 1: this is the first 'argument'
Argument 2: and then the second