To access an individual character in one of the command line arguments, add a second index to argv. - C Function

C examples for Function:main function

Introduction

The following program displays all of the arguments with which it was called, one character at a time:

Demo Code

#include <stdio.h>

int main(int argc, char *argv[])
{
   int t, i;//from   www .java2 s  . c  om

   for (t = 0; t<argc; ++t) {
      i = 0;
      while (argv[t][i]) {
         putchar(argv[t][i]);
         ++i;
      }
      printf("\n");
   }

   return 0;
}

Related Tutorials