Slashdot Mirror


Don't Overlook Efficient C/C++ Cmd Line Processing

An anonymous reader writes "Command-line processing is historically one of the most ignored areas in software development. Just about any relatively complicated software has dozens of available command-line options. The GNU tool gperf is a "perfect" hash function that, for a given set of user-provided strings, generates C/C++ code for a hash table, a hash function, and a lookup function. This article provides a reference for a good discussion on how to use gperf for effective command-line processing in your C/C++ code."

3 of 219 comments (clear)

  1. i tooted by Anonymous Coward · · Score: -1, Offtopic

    ~8 i r dobernala geeklord terd on my hunnies they heart this! *l*

    1. Re:i tooted by Anonymous Coward · · Score: -1, Offtopic

      i tooted
      Beans, beans, the musical fruit. The more you eat, the more you toot.
  2. Re:only relevent to static linking by joto · · Score: 0, Offtopic

    In exactly which way does templates NOT increase executable size?

    The C++ standard library consists almost entirely out of header files, that must be instantiated before they can be used. Just because you are used to assume that iostreams deals with char's, doesn't mean that this isn't hidden behind umpteen layers of template hell in the C++ header files. And given that gcc doesn't do explicit template instantiation very well (at least the last time I bothered to check), I'll bet that these instantiations does not exist in any dynamically linked library, but must exist separately for every single program written in C++.