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

C/C++ Sources

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

AUTHOR BACKGROUND

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 http://www.hal9k.com, or email to sysop@hal9k.com.

FOCUS ON STL

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:

STL TUTORIALS

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:

http://www.cs.brown.edu/people/jak/programming/stl-tutorial/tutorial.html

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:

http://www.xraylith.wisc.edu/~khan/software/stl/STL.newbie.html#class_howto

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.

http://www.cs.rpi.edu/~musser/stl.html

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.

http://www.aw.com/cp/musser-saini-source.html

STL VENDOR-SPECIFICS

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:

http://www.cs.rpi.edu/~wiseb/stl-borland.html

or download Wise's patched STL files directly at:

http://www.cs.rpi.edu/~wiseb/stl/stlexp.zip

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:

http://www.microsoft.com/visualc/v4/v4tech/stlchg.htm

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.

http://www.cyberport.com/~tangent/programming/stlres.html

STL POINTER PAGES

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

STL USENET NEWSGROUP RESOURCES

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:

ftp://butler.hpl.hp.com/stl/stl.faq

READER SUGGESTED LINKS

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.

http://gauge.phys.uva.nl:2001/c-sources.html
or try
ftp://ftp.usc.edu:/pub/C-numanal/numcomp-free-c.gz

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.

http://info.desy.de/user/projects/C++.html

If you would like to share some of your favorite C/C++ sources, please email me at sysop@HAL9K.com.

C/C++ MAILBAG

Here's a sampling of queries which have come to me recently via email.
Larry_Siden@msn.com 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
     priced."

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
     ftp://ftp.cdrom.com/pub/cica/win3/programr/cxtw107.zip

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

75300.2257@compuserve.com 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 (http://www.talentcom.com/iview/iview.htm) to use with it. A hypertext index of CUG CD-ROM is available online at http://www.HAL9K.com/cug/. " d8342012@ccunix.ccu.edu.tw 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: http://ulgham.ncl.ac.uk/C++SIM/homepage.html

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: http://www.comnets.rwth-aachen.de/doc/cncl.html

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