用Linux下的getopt类函数解析参数列表
在GNU下有getopt类的函数可以轻松解析参数列表,省去很多烦恼,定义如下:#include <unistd.h>int getopt(int argc, char * const argv[],const char *optstring);extern char *optarg;extern int optind, opterr, optopt;#define _GNU_SOURCE#include <getopt.h>int ...