The function main can be declared with or without parameters.
int main(int argc, char *argv[])
Although any name can be given to these parameters, they are usually referred to as argc and argv.
The first parameter, argc (argument count), has type int and indicates how many arguments were entered on the command line.
The second parameter, argv (argument vector), has type array of pointers to char array objects. char array objects are null-terminated strings.
The value of argc indicates the number of pointers in the array argv. If a program name is available, the first element in argv points to a character array that contains the program name or the invocation name of the program that is being run. If the name cannot be determined, the first element in argv points to a null character.
This name is counted as one of the arguments to the function main. For example, if only the program name is entered on the command line, argc has a value of 1 and argv[0] points to the program name.
Regardless of the number of arguments entered on the command line, argv[argc] always contains NULL.
Related References