Friday, September 23, 2011

WAP to retrieve command line arguments


/*
  Name: WAP to retrieve command line arguments
  Copyright:  Copyright Paul Griffiths 2000
  Author:  Parveen Malik
  Date: 23/09/11 01:40

*/
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
    int n = 0;

    while ( n < argc ) {
	printf("Command line argument %d is %s\n", (n+1), argv[n]);
	++n;
    }

    return EXIT_SUCCESS;
}

0 comments:

Post a Comment