Beginner to C, need help with command-line stuff..

This is a discussion on Beginner to C, need help with command-line stuff.. within the C Programming forums, part of the General Programming Boards category; So I've gotten kinda stuck. I'm trying to figure out this command-line arguments stuff.
Basically if a user enters an ...

argc contains the number of command-line arguments. So if you want to do something with each argument then create the loop as illustrated above. argc will always be at least 1 because the first argument is always the name of the program that is running.

Now if you want to actually use the value that was typed on the commnd-line you will have to convert it to an integer. There are other conversion functions, but atoi() will be sufficient as long as you don't enter some ridiculously huge number on the command line.