The parameter char * argv[]
decays to a pointer, char ** argv
. You can equally well write the function signature for main()
as:
int main(int argc, char ** argv)
You can do what you like with the pointer argv
within main()
, so argv++
for example just bumps argv
to point at argv[1]
rather than argv[0]
.
argv ---> argv[0] ---> "program"
argv[1] ---> "arg1"
argv[2] ---> "arg2"
... ...
argv[argc] == NULL