1 /*--------------------------------------- 2 repeat.c -- 带参数的 main() 3 ---------------------------------------*/ 4 5 #include <stdio.h> 6 7 int main(int argc, char *argv[]) 8 { 9 printf("The command line has %d arguments:\n", argc - 1); 10 11 for (int count = 1; count != argc; ++count) 12 printf("%d: %s\n", count, argv[count]); 13 14 printf("\n"); 15 16 return 0; 17 }
第 11 章 字符串和字符串函数(命令行参数)
转载于:https://www.cnblogs.com/web1013/p/9121868.html