Index: [thread] [date] [subject] [author]
  From: Luke <lop@duke.edu>
  To  : 
  Date: Sun, 28 Feb 1999 15:29:44 -0500

getopt

I am having a little trouble understanding the getopt library
implentation.

The specifications call for iterators and const iterators.  What is the
difference?  I'm assuming we need something in the order of begin() and
end() and operators ++ and * for incrementation and derefrencing,
respectively, and a public iterator type so that users of the class can
declare iterators.

Changing things so GetOpt uses strings and vectors shouldn't be too
hard.  However, the C getopt has several static C variables that aren't
really passed anywhere and just appear in the program, namely char
*optarg and int optind.  This seems kinda sloppy for a
C++ implementation.  I'm assuming converting the first to a static
string, leaving the second as is, and just using it the same way that it
would be in C is not a good idea??  Would it be better to pass an int
and a string to getopt by reference and do it that way?

My next question is about classes in this library.  The assignment makes
it seem like we should have a lot of classes here- I can see having one
for getopt and one for readenv, or something like that, but what else?
I'm assuming we need to have sorters, but should we try to integrate
them with the sorters in scandir?

Also, is anyone else just a little frustrated that the link to
usegetopt.cc doesn't work and this thing is due monday?

I am confused.  PLEASE HELP!!!
-Luke



Index: [thread] [date] [subject] [author]