int main(int argc, char** argv) { int x = argc; printf("argc is :%d ",x); int i; for(i=1;i<=x;i++){ printf("the %d parameter is :%s ",i,*(argv+i-1)); } return (EXIT_SUCCESS); }
argc 记录的是输入参数的个数,*argv则记录的是输入的参数的值;