C examples for Function:main function
The following program displays all of the arguments with which it was called, one character at a time:
#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; }