Previous Table of Contents Next


The Plan of this Book

People in the market for a book on C++ have usually spent some time living with C and want to know what's new, different, and exciting about C++ compared to C. Aside from a few differences (which I make a point of highlighting), almost all C code can be recompiled as C++. You don’t have to learn a whole new language; you mainly just need to learn what’s new.

If you know C well enough and want to get to the heart of C++, you should start with Chapter 5, “A Touch of Class,” in Part II. This part of the book focuses on learning the new features of C++, particularly object orientation, given a background in C. You may want to first skim through Part I, paying close attention to notes identified with the “C/C++” icon.

People who already know C might also want to look at the sections on stream operators in Chapter 4. You don't have to use these operators, but many C++ programmers prefer them over the traditional C input-output functions.

Part I is provided so as not to leave anyone out in the cold. it provides a brief review of features common to C and C++. If you’re unfamiliar with C, though, I recommend that you start with the previous book in this series, C in Plain English, especially if you don't have much programming experience. These two books have some overlapping material, but they are designed to complement each other. C in Plain English devotes more space to the idiosyncrasies of C syntax (although I touch on them in this book as well), and all these quirks carry over into C++.

Part III covers some advanced topics not covered in Parts I and II along with a guide to the C++ language, organized as an A-to-Z reference. This organization lets you look up exotic C++ features as well as get concise, to-the-point descriptions of terms, such as encapsulation, data abstraction and inheritance, that are peculiar to C++ and object orientation. You may have heard these terms kicked around for a long time without coming across clear explanations of them—until now.

Throughout the book, I’ve placed several different kinds of notes, identified by the following icons.

This icon signifies a technical note that digresses from the main discussion. There are many ands, ifs, and buts in C++, not because the language is arbitrary but because it is so flexible. To be technically correct without being too distracting, the text relegates additional information to notes.

This icon points to information about a common language feature that is supported by both C and C++ but is handled differently. C has some restrictions that C++ does not have, and vice versa. You’ll want to pay special attention to these notes if you’re porting C code to C++ or if you’re a C programmer moving to C++.

This is a note that recommends an alternative way to do something that might be faster or more convenient. These notes are always in the form of a mild suggestion.

C++: The Future Is Now

Predicting the future is a tricky business. As St. Augustine once observed, the only real moment is the present, and the future is only imagined.

All the same, it is not hard to see that the future of C++ is big. The architecture of new operating systems is inclining more and more toward object orientation. If you want to work with these systems, you'll need to learn to package software as objects—independent units that can respond to messages. And in this area, C++ excels.

Beyond that, C++ corrects some of the sloppiness of C with regard to types, while retaining C's efficiency and direct access to the hardware. C++ is the systems programming language of the future and not just of the moment.

You should be forewarned that C++ is best learned a little a time. A novice is likely to be overwhelmed by the number of strange incantations in the literature (encapsulation, virtual function, abstraction. Don’t let the terminology intimidate you. C++ is not an arcane priesthood (despite all the magic words thrown around. Instead, it’s an exceptionally broad set of useful tools ranging from low-level operations to elegant object-oriented descriptions of data. If you only have the patience to learn them one at a time, these tools will serve you well.


Previous Table of Contents Next