INtime SDK Help

Gets the next argument option letter that matches recognized option letters.

#include <unistd.h>

char getopt (int argc, char **argv, char optstring);
char *optarg /* Global variables affected by getopt */ int optind


argc, argv
Standard command line arguments passed to main.
A string of recognized option letters.


This function compares command line arguments found in argv with optstring. The found argument is indicated in the global variables optarg and optind, where optarg points to the argument, and optind is set to the argv index of the next argument on the command line. On return from getopt, optarg is set to point to the start of the option argument, if any.

If a letter in optstring is followed by a colon, the option is expected to have an argument that may be separated by white space in the command line.

Return Values


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/unistd.h unistd.h clib.lib