[LC++]getopt(3)

Julien Patrick Claassen julien at c-lab.de
Thu Feb 13 23:20:02 UTC 2003


Hello!
  Try the linux/unix man-page, there is a demo program. You just do something
like that:
  while(getopt(argc,argv,"hvi:"))
  { }
  In the while-loop you can switch on the found options. I think the found
characyters are returned directly. The function-call above means there are
valid options:
  -h -v and -i. -i takes an argument, that is signalled by the ':'. So in each
case-statement you call a specific function like:
  case 'h': { help(); }
  I hope that helps.
     Kindest regards
        Julien

Julien Patrick Claassen
jclaassen at gmx.de
julien at c-lab.de
http://www.geocities.com/jjs_home

SBS C-LAB
Fuerstenallee 11
33102 Paderborn

Phone: (+49) 5251 60 6060
Fax: (+49) 5251 60 6065

www.c-lab.de




More information about the tuxCPProgramming mailing list