easiest way is to use argc and argv in your "main" function.
int main(int argc,char *argv[]);
where argc is a count of the number of parameters and argv is an array of pointers to the actual strings themselves. By default, argv[0] is the name of your application. So if you wrote a program named foo and it's main looked like this:
int main(int argc,char *argv[])
{
for (int i = 0;i <= argc;i++)
printf("argv[%d] == %s\n",i,argv);
}
If you execute
./foo abc 123
then your output should look like:
0 == foo
1 == abc
2 == 123
The only somewhat tricky thing to remember is the argv[0] thing, since your array will actually contain 1 more element than argc tells you (since 0 is always assumed). Also, the exact format of argv[0] varies between os's. Some give you just the executable, some give you a full path (e.g. /usr/bin/foo), some vary depending on exactly how it was launched:
./foo could give you 'foo' or '/usr/bin/foo' or './foo'
../bin/foo could give you 'foo', or '/usr/bin/foo' or '../bin/foo'.
etc