AAA
AAA

Reputation: 367

How does argc in C works?

int argcin 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

Answers (1)

chux
chux

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

Related Questions