extern int optind;
optind
optind holds the current index of the array argv[], which contains the command line options being parsed by getopt().
argv