转 自 http://www.diybl.com/course/3_program/c /cppjs/20091031/180765.htmlgetopt被用来解析命令行选项 参数。就不用自己写东东处理argv了。#include <unistd.h> extern char *optarg