目录
getopt
https://blog.csdn.net/weixin_40763897/article/details/87898328
https://www.cnblogs.com/ggzhangxiaochao/p/15023341.html
getopt_long
http://xinyiworld.top/wordpress_it/?p=7140
https://www.jianshu.com/p/80cdbf718916
1.外部变量
https://blog.csdn.net/tianya_lu/article/details/133581665
2.参数类型
不带冒号:没有参数
带1个冒号:有参数
带2个冒号:可选参数
3.常见问题
- getopt结束时返回的是255,不是-1.
https://www.coder.work/article/1570895
getopt() 返回 int,所以你真的应该将 t 声明为 int 来匹配,但是如果你准备使用 char,你将需要使用 signed char。
0 条评论