Quantcast
Channel: Command line arguments in C - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Command line arguments in C

$
0
0

I have this program execute with the values 10,20,30 given at command line.

int main(int argc , char **argv) {   printf("\n Printing the arguments of a program \n");  printf("\n The total number of arguments in the program is %d",argc);   while(argc>=0)    {      printf("%s   ",argv[argc]);     argc--;     }     return 0;  }    

The outputs is The total number of arguments in the program is 4(null) 30 20 10 ./a.out

Where did that (null) come from ??


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles



Latest Images