A program to list the command line arguments : Command Line Parameters « Development « C / ANSI-C






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;
}


           
       








Related examples in the same category

1.Parse Arguements
2.Check the command line parameters
3.Process the command line input
4.Verify the user input and display file content
5.Check the command line input
6.Command line parameter: display all of them
7.Use the command line parameter
8.Check the command line parameter and use it
9.Check the command line parameter: if less than required exit