Process the command line input : Command Line Parameters « Development « C / ANSI-C






Process the command line input


#include <stdio.h>

int main(int argc, char *argv[])
{
  int t, i;

  for(t=0; t<argc; ++t) {
    i = 0;

    while(argv[t][i]) {
      putchar(argv[t][i]);
      ++i;
    }
    printf("\n");
  }

  return 0;
}

  

           
       








Related examples in the same category

1.Parse Arguements
2.A program to list the command line arguments
3.Check the command line parameters
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