/* * ISA 563, Spring 2011 * Copyleft by Muhammad Abdulla */ #include /* * argtest.c -- demonstrates how to access argument line arguments */ int main (int argc, char *argv[] ) { int i; // print the number of arguments first printf("This program is called with %d argument%c\n", argc, argc == 1 ? '\0' : 's'); // print all the arguments that are accessable for ( i = 0; i < argc; i++ ) { printf("argument[%d]: ", i); printf("%s", argv[i]); //printf(argv[i]); // this is not secure printf("\n"); } return 0; }