第 11 章 字符串和字符串函数(命令行参数)

 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:
", argc - 1);
10 
11     for (int count = 1; count != argc; ++count)
12         printf("%d: %s
", count, argv[count]);
13     
14     printf("
");
15     
16     return 0;
17 }
repeat.c

原文地址:https://www.cnblogs.com/web1013/p/9121868.html