People are talking about Genitor...
Visit Genitor Corporation Online Now!

C/C++ Sources

By Victor R. Volkman
September 1996 (No. 5)


Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to the C/C++ Users Journal since 1987. His most recent book is entitled Windows Programming with Shareware Tools. He can be reached at the HAL 9000 BBS (313)663-4173, on the web at, or email to


The WWW has historically been one of the most informative sources of information about leading edge programming technologies. Though STL has been around for a few years now, its only recently made its way out of computer science labs and into the toolkits of corporate application developers. My quick survey of WWW via the AltaVista search engine yielded more than 1,000 documents. After considerable weeding, I'm happy to share with you some of the more relevant pages in several subcategories: tutorials, vendor-specific pages, and pointer-pages:


Jak Kirman of the CS faculty at Brown University has thrown together what he considers "a very modest tutorial" on STL. You can read it as a hypertext document or print it out in Postscript for offline perusal. Kirman motivates the discussion with a look at the STL "sort" template while introducing each of the five categories of STL components one at a time. Other sections address the philosophy of STL and extending STL to meet your own needs. Kirman makes good use of graphical figures to illustrate his points. Check it out for yourself at:

Mumit Khan at the Center for X-Ray Lithography in the University of Wisconsin provides an exhaustive amount of advice and coding examples (163KB) in his "STL Newbie Guide". Major headings include: Writing Container Objects, Pointers and STL, STL Iterators, Persistent STL, and a new section about Predicates, Comparators, and General Functions. In addition to how-to information, he specifically addresses common pitfalls such as "Gotchas with Storing Pointers to Objects". Its all at:

David R. Musser has collected some introductory information, example applications that use STL, and pointers to other STL reference sources. Specifically, Musser's "Standard Template Library" page includes example source code for demonstrating STL vectors and vector iterators, an anagram checking application, and searching and sorting user-defined records. More advanced users may want to look at the official ANSI/ISO STL specifications (available in Postscript form) there.

David R. Musser and Atul Saini, authors of STL Tutorial and Reference Guide: C++ Programming with the Standard Template Library offer a set of source code resources specific to their book. More than 70 example programs are available and you can browse selected parts of the book. Certainly, the website will belp you decide whether Musser and Saini's book would be appropriate for you.


G. Bowden Wise , also of the CS faculty at Rensselaer Polytechnic Institute has published a pragmatic set of notes entitled "Using the The Standard Template Library with Borland C++". In this document, he describes how to make STL work properly with Borland C++ 4.5 and optionally with Borland's Object Windows Library (OWL). Specifically he details changes to algobase.h, funtion.h, defalloc.h and other header files. Also appearing are detailed explanations of the known warnings that the Borland compiler emits while processing STL. You can read about it at:

or download Wise's patched STL files directly at:

Microsoft's "MFC and Standard Template Library (STL) Alert" page provides a blistering disclaimer in which it places sole responsibility for STL back on Hewlett-Packard (who originally placed STL in the public domain). Furthermore, it goes on to say that Microsoft Product Support Services will not assist in technical support issues on STL. Nevertheless, it does highlight required changes to header files (involving Namespaces) that you can make yourself to achieve compatability with Windows SDK or Microsoft Foundation Classes (MFC) and STL. Visit their URL at:

Warren Young publishes the "STL Resource List", an extensive online catalog of pointers to pages detailing the STL support of C++ compilers. It also contains pointers to FTP sites where you can download a specially-tweaked version of the STL files for your specific compiler. Among the compiler vendors cited are:

Young is also creator of the STL Compatability Test Suite (also on this page). This is a good attempt to benchmark some key features of STL to see whether your compiler's STL implementation will pass muster. Currently, it tests the four major containers: vector, deque, list, and map. It also performs a few tests on algorithms and gives iterators and alllocators a workout.


Here's some "pointers to pointers", these are pages which provide a rich set of jumping off points for your own exploration of STL:


Usenet newsgroups provide an ongoing discussion about the pros and cons of STL implementations. Jan Charvat, a graduate student in Computer Science at the University of California (Riverside), recommends the following newsgroups for STL coverage:

Before posting to Usenet, make sure you've read the STL FAQ, available at:


Paulo Eduardo Neves at Laboratorio de Metodos Formais in Rio de Janeiro, Brazil submits his favorite set of C/C++ links. As usual, I'll provide a brief description of each.

Ajay Shah at the Centre for Monitoring Indian Economy, Bombay compiles the "Free C/C++ Sources for Numerical Computation" page. As the name implies, it is an index of pointers to other types of information, including:

Unlike many other resource lists, this one specifically cites the author name, supported platforms, FTP site, and version information.
or try

The "C++ Virtual Library" maintained by Lutz Lilje is a website that has something for everyone from the C++ newbie to those on the bleeding edge of the C++ standards. As you might expect, such a site is primarily focused on providing useful links to authoritative sources of information. Lilje's page is one of the most active programming resources on the web and has earned the coveted "4-Star Site" award from Magelllan for his efforts. Specific areas of interest include:

There are few sites I return often enough to merit a bookmark, the "C++ Virtual Library" is definitely on my hot links list.

If you would like to share some of your favorite C/C++ sources, please email me at


Here's a sampling of queries which have come to me recently via email. writes:
     "At my work, we might be able to use a program that can analyze C source
     code and generate a call tree along with various programming metrics.
     Do you know of any shareware like that?  There's commercial stuff, but
     it costs in the thousands.  I'ld like to find something more reasonably

C/C++ Answer Man:

     "There's no need to pay a fortune for good source code analysis
     (how about just 47$ for a great shareware program?).  Try C
     Exploration tools for Windows, its C Function Tree and C Structure
     Tree make program and data structure logic as clear as can be.  As
     for metrics, I'll highlight only a few of them here:"

   * Number of source code lines for every file
   * Number of included files for every source file
   * For every defined function:
        * Number of lines
        * Number of functions  called
        * Number of flow control statements
        * Maximum brace nesting level
        * Whether its used only in this file
    * Function or data type reference list for every file
    * Location of multiply defined functions & data types
    * Location of all overloaded C++ functions
    * #include file dependencies for every source file
    * #include file tree for nested #includes
    * Cross-reference for every function or data type
    * Parent/child relationship for functions & data types
    * C++ class inheritance tree
    * C structure/union byte offset calculation

     Check out volume #437 on the CUG CD-ROM or by FTP at

Available on C/C++ Users Group CD-ROM writes: "I would prefer a better method of searching for information and code on the CUG CD-ROM (please bear in mind that my only exposure is the 1994 CD). A hyper-text style index with search functions is preferable." C/C++ Answer Man: "Ask no more! The June 1996 edition of C/C++ Users Group CD-ROM includes a hypertext index of volumes 400-437 by, Subject keywords, Title, Language, and Platform (OS/CPU). Whats more, you even get a FREE licensed version of the popular I-VIEW offline HTML viewer ( to use with it. A hypertext index of CUG CD-ROM is available online at " writes: "I am interested in simulation, especially discrete event driven simulations." C/C++ Answer Man: "Well, since you didn't specifically ask for C or C++, I'll assume that C++ class libraries will work for you. I have two specific packages I think you should look at: C++SIM and CNCL. The C++SIM discrete event process based simulation package provides Simula-style class libraries. C++SIM was written by M.C. Little and D. McCue at the Department of Computing Science in the University of Newcastle upon Tyne (England). The same distribution also includes the SIMSET linked list manipulation facilities. According to MacLennan (1983), Simula was the first computer language to incorporate the ideas of a "class" and "object" constructs in 1967. SIM++ currently claims usability only on Unix workstations, such as SUN Sparcs. C++SIM version 1.0 (released 06/15/92) is now available as volume #394 on the CUG CD-ROM. See also the C++SIM home page:

Available on C/C++ Users Group CD-ROM

The Communication Networks Class Library (CNCL) is a C++ library created by the Communication Networks department of Aachen. CNCL is both a class library featuring generic C++ classes as well as a simulation library with strong points in random number generation as well as statistical and event-driven simulation. CNCL v1.4 (released 01/05/96) is available on the CUG CD-ROM as volume #443. See also the CNCL home page:

Available on C/C++ Users Group CD-ROM

<H2>Up</H2> <H2>Prev Doc</H2> <H2>Next Doc</H2>
This page maintained by Victor R. Volkman
Last updated on 10/29/96