Example of command line parameters
file example.c:
int main(int argc, char **argv)
{
int i;
for (i=0; i<argc;i++) {
printf("%s\n", argv[i];) // note the switch from
// pointer to array view.
}
return 0;
}
compile and run:
gcc example.c
./a.out one two three
a.out
one
two
three