getopt----解析命令选项及参数
形式:
int getopt(argc,argv,”参数列表”);
int getopt(int argc, char *const argv[],const char *optstring);
调用一次,返回一个选项。在命令行选项参数再也检查不到optstring 中包含的选项时,返回-1,同时optind储存第一个不包括选项的命令参数。
何为 选项 ,参数**
字符串 opts
原创
2017-09-21 09:57:52 ·
436 阅读 ·
0 评论