There is another
main functio
n signature that allows us to work with the
command-line arguments. These are arguments we can pass to our executable file in the command line. Example:
Here, the
myexe is the name of our executable file, and
param1 and
param2 are some arbitrary arguments we pass in. The function
main that allows us to parse these arguments has the following signature:
int main(int argc, char *argv[])
The argc is the number of command-line arguments we pass to our executable. The argv is the pointer to an array of strings that represent the ...