Thomas Ruschival said:
just use the standard C function readdir()
While readdir is in a standard, it's in the POSIX standard, not the C
standard.
the best thing about c++ is, you an use almost all th C-Libraries that have
been developped ever since K&R invented C
C was invented and in wide use for a LONG time before readdir was
invented (before System V or so, directories also followed the UNIX
dictum that everything be treated as files -- a directory was just a
file full of structures of a specific type).
While Brian Kernighan helped write the original book on C, he did not,
by all accounts, help to invent the language -- if you were going to
give credit to anybody but Dennis Ritchie, possibilities might include
Ken Thompson (invented B, C's progenitor as well as the UNIX system to
which C was so closely bound, early on), Martin Richards (inventor of
BCPL, the progenitor of B) and/or Doug McIlroy (apparently invented
C's preprocessor, among many other things).
Though I wasn't present at the time, so my opinion should be taken
with a grain of salt, my own nomination in this category would
probably be Doug McIlroy -- reading books, papers, etc., it seems to
me like he influenced nearly every part of early UNIX and
(particularly) may have been one of the most careful about getting
things _right_ rather than "close enough."