Take a look at the manpage for the getopt() library call. Note that what you need is the page in manual section 3 (i.e., "man 3 getopt), and if you just type "man getopt" you'll get the page for the getopt command (in section 1). There is also a manpage for the POSIX version of getopt() in section 3p. Since you posted in a Non-*NIX forum, it's hard to know which you might want.
There's a decent example at the end of the manpage.
|