Mega Code Archive

 
Categories / C / Development
 

A program to list the command line arguments

#include <stdio.h> void main(int argc, char *argv[]) {   int i = 0;   printf("Program name: %s\n", argv[0]);   for(i = 1 ; i<argc ; i++)     printf("\nArgument %d: %s", i, argv[i]);   return 1; }