The main() function’s double life :::
- int main (int argc, char *argv[]);
- int main (int argc, char **argv);
The global variables set by getopt() include:
- optarg ::: A pointer to the current option argument, if there is one
- optind ::: An index of the next argv pointer to process when getopt() is called again
- optopt ::: This is the last known option
If you don’t want getopt to print error message, you can set opterr to zero
————————————————————————————————-