optarg, opterr, optind, optopt

variables used by the getopt() function 

Global Variables


SYNOPSIS

#include <unistd.h>

extern char *optarg;

extern int opterr;

extern int optind;

extern int optopt;


DESCRIPTION

The optarg, opterr, optind, and optopt variables are used by the getopt() function. optarg indicates an optional parameter to a command line option. opterr can be set to 0 to prevent getopt() from printing error messages. optind is the index of the next element of the argument list to be process, and optopt is the command line option last matched.

Programs should obtain these definitions by the inclusion of <unistd.h>. The practice of defining the variables in a program as

extern char *optarg;

(without including <unistd.h>) is unsupported.


CONFORMANCE

UNIX 98.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
getopt()


PTC MKS Toolkit 10.5 Documentation Build 40.