Tuesday, November 1, 2011

getopt()

Calling getopt() more than once within a program, after parsing a set of argv strings, will immediately fail even if you call it with a different set of strings.  You must set optind to one before calling getopt() again.