- 论坛徽章:
- 0
|
The variable optind is the index of the next element to be processed in argv. The system initializes this
value to 1. The caller can reset it to 1 to restart scanning of the same argv, or when scanning a new
argument vector.
If getopt() finds another option character, it returns that character, updating the external variable
optind and a static variable nextchar so that the next call to getopt() can resume the scan with the fol-
lowing option character or argv-element.
If there are no more option characters, getopt() returns -1. Then optind is the index in argv of the
first argv-element that is not an option.
指向argv下一个元素的索引, 这指的是什么啊
试过printf optind, 可是有参数的得到3,没参数的是2. |
|