getopt函数原型
时间: 2023-10-18 08:00:13 浏览: 90
getopt()函数的原型是:
```c
int getopt (int argc, char * const argv[], const char * optstring);
```
其中,argc和argv通常直接从main()函数的参数传递而来,分别表示命令行参数的个数和字符串数组。
optstring是一个包含正确的选项字符串,用于指定哪些选项需要参数,哪些不需要。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [C语言getopt()函数](https://blog.csdn.net/toyijiu/article/details/129532747)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [getopt函数](https://blog.csdn.net/qq_37050329/article/details/88966943)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文