[Techtalk] simple reference book on C++

Kathryn Hogg kjh at flyballdogs.com
Thu Jan 31 23:23:55 EST 2002


> To compile:
>
> g++ -ohello hello.c

I recommend that people keep C & C++ files with different extensions. ".c"
is traditional for C.  I recommend .cc for C++ even though we've used .C
for about 12 years.  Some OS's don't really have case sensitive file
extensions which can be a real pain. Renaming files is not always that easy
especially when you are using CVS.  I like different file extensions to
help out make because not all C code can compile with C++.

But, even if you are writing C code, I really recommend using the C++
compiler because of the much, much better type checking.

> I don't recommend it as a teaching book unless you already know C. I do
> recommend it as a reference (if there's an update)/upgrading to
> C++/general reading for C or C++ programmers book.

I'd highly recommend a good book on the standard library. Standard C++
includes a rich template library which used to be called the Standard
Template Library (STL).  I have Matt Austern's book but it doesn't cover
Standard iostreams and is probably a little old (the standard was still in
draft).  After programming in C++ for 14 years, I'm just wrapping up
porting our code (1.3 million lines) to standard C++.  I didn't do all the
work, I just made sure that people did things smartly.  Our code runs on
Linux with gcc, HPUX with aCC, Digital Unix (cxx), Solaris (Sun CC), AIX
(Visual Age compiler), and windoze (msvc++) so I'm a little persnickity
about writing portable code and working around variances in different
compilers.

--
Kathryn





More information about the Techtalk mailing list