getopt()
来源:互联网 发布:淘宝追加评论时间 编辑:程序博客网 时间:2024/05/22 14:30
page815
#include <fcntl.h >
int getopt(int argc, const *const argv[],const char *options)
getopt():
命令行选项参数的解析函数
argc:
(main函数传入的参数argc,参数的总个数)
argv:
(main函数传入的参数argv)
options:
(命令行的选项)
当选项后跟了:(冒号),表示选项后带参数
return:
(下一个参数的字符或者当所有选项参数都处理完返回-1)
remarks:
1. command [-i] [-u username] filename
i:u为传入getopt的options选项参数
2. getopt循环依次处理选项,当所有选项都遍历处理完毕后才终止,返回-1
3. 命令行的选项参数都是 有一个'-'开始的,例如:ls -l (l就是选项)
4. optarg,若命令行带参数,optarg指向改参数
0 0
- getopt
- getopt
- getopt
- getopt
- getopt
- getopt
- getopt ()
- getopt
- getopt
- getopt
- getopt
- getopt
- getopt
- getopt()
- getopt
- getopt
- getopt()
- getopt
- 真正的中国天气api接口xml,json(求加精) ...
- nginx安装与配置
- 如何找到最重要的事情?
- poj1905(计算几何+二分)
- Linux下安装Nginx详细图解教程
- getopt()
- 我的PHP之路--学习笔记(1)
- 向架构师进军-->可重用架构资源
- 异常处理+代码混淆(Crashlytics+proguard)
- Android推送方案研究
- Android Bitmap 全面解析(二)加载多张图片的缓存处理 ...
- python - 文件枚举
- ubuntu 12.04 下nginx安装步骤
- Jquery 动态添加dom后,再为其绑定事件