/* ** $Id: arguments.c 713 2008-01-28 19:46:41Z phf $ */ #include #include /* argc = argument count, argv = argument vector (= array) */ int main( int argc, char *argv[] ) { int i = 0; for (i = 0; i < argc; i++) { puts( argv[i] ); } return EXIT_SUCCESS; } /* ** Commentary ** ** The for loop here follows the "traditional" C89 pattern where ** you have to define the loop variable *outside* the loop. In ** C99 we could have declared "i" as part of the initialization, ** and we'll use that shorter form in the future. */