echoall
#include <stdio.h> int main(int argc, char *argv[]) { int i; extern char **environ; for(i = 0; i < argc; i++) { printf("argv[%d]: %s\n", i, argv[i]); } /*argv[argc] is NULL according to ANSI C*/ /* while(*argv) { printf("%s\n", *(argv++)); } */ /* while(*environ) { printf("%s\n", *environ++); } */ return 0; }