Reputation: 367
int argc
in C is an integer variable that holds the number of arguments that are passed to the program through the command line . Since we don't pass any integer to the command line while executing the program , then which component is responsible for passing the number of arguments to argc
variable ?
Upvotes: 0
Views: 277
Reputation: 153537
The "command line" is input to a shell program. It is that program that parses the line and forms argc
and the NULL
terminated array for argv
and then calls the C program.
Upvotes: 2