Monday, February 17, 2020

command line arguments


#include <stdio.h>
int main(int argc, char *argv[])
{
  int c;
  printf("Number of command line arguments passed: %d\n", argc);
  for (= 0; c < argc; c++)
    printf("%d argument is %s\n", c + 1, argv[c]);
  return 0;
}
This program prints the number of arguments and their contents.

No comments:

Post a Comment