csci4061/notes/03-process-basics-code/print_args.c

12 lines
218 B
C
Raw Normal View History

2018-01-29 23:28:37 +00:00
// Print all the arguments in the argv array
#include <stdio.h>
int main(int argc, char *argv[]){
printf("%d args received\n",argc);
for(int i=0; i<argc; i++){
printf("%d: %s\n",i,argv[i]);
}
return 0;
}