In many C++ IDE\'s and compilers, when it generates the main function for you, it looks like this:
int main(int argc, char *argv[])
When I
argc is the number of arguments being passed into your program from the command line and argv is the array of arguments.
argc
argv
You can loop through the arguments knowing the number of them like:
for(int i = 0; i < argc; i++) { // argv[i] is the argument at index i }