声明:所有文章只作为学习笔记用,转载非原创
https://www.cnblogs.com/NickQ/p/11368656.html
- getopt()函数
getopt()用来解析命令行选项参数的,但是只能解析短选项: -d 100,不能解析长选项:--prefix;其原型:
getopt_long()函数
getopt_long()是在getopt()的基础上的拓展,可以获取长参数,如获取--help这种参数。其原型如下:
int getopt_long(int argc, char * const argv[], const char *optstring, const struct option *longopts, int