First you need to understand how command line arguments work in C...
Code:
int main ( int argc, char *argv[] )
The integer value argc tells you how many command line arguments there are. You need to check this to be sure the command line was correctly entered by the user and to know how many argv[] strings to expect.
The character arrays at argv[] will contain one string for each command line parameter. The breakpoint in unquoted command lines is a space...
Thus if the user enters... myprog 1 2 3 ... argc should contain 4 meaning there are 4 parameters. The breakdown is like this...
argv[0] = myprog
argv[1] = 1
argv[2] = 2
argv[3] = 3
These are string variables. You can convert the strings to numerical values with atoi() and similar functions.