As the reader of this book,
You can email or write directly to let us know what you did or didn’t like about this book—as well as what we can do to make our books stronger.
When you write, please be sure to include this book’s title and author as well as your name, email address, and phone number.
Email: [email protected]
Mail: Reader Feedback
Addison-Wesley Developer’s Library
800 East 96th Street
Indianapolis, IN 46240 USA
Reader Services
Visit our website and register this book at www.informit.com/register for convenient access to any updates, downloads, or errata that might be available for this book.
Introduction
Learning C++ is an adventure of discovery, particularly because the language accommodates several programming paradigms, including object-oriented programming, generic programming, and the traditional procedural programming. The fifth edition of this book described the language as set forth in the ISO C++ standards, informally known as C++99 and C++03, or, sometimes as C++99/03. (The 2003 version was largely a technical correction to the 1999 standard and didn’t add any new features.) Since then, C++ continues to evolve. As this book is written, the international C++ Standards Committee has just approved a new version of the standard. This standard had the informal name of C++0x while in development, and now it will be known as C++11. Most contemporary compilers support C++99/03 quite well, and most of the examples in this book comply with that standard. But many features of the new standard already have appeared in some implementations, and this edition of
• Classes and objects
• Inheritance
• Polymorphism, virtual functions, and runtime type identification (RTTI)
• Function overloading
• Reference variables
• Generic, or type-independent, programming, as provided by templates and the Standard Template Library (STL)
• The exception mechanism for handling error conditions
• Namespaces for managing names of functions, classes, and variables
The Primer Approach
• A primer should be an easy-to-use, friendly guide.
• A primer doesn’t assume that you are already familiar with all relevant programming concepts.
• A primer emphasizes hands-on learning with brief, easily typed examples that develop your understanding, a concept or two at a time.
• A primer clarifies concepts with illustrations.
• A primer provides questions and exercises to let you test your understanding, making the book suitable for self-learning or for the classroom.
Following these principles, the book helps you understand this rich language and how to use it. For example
• It provides conceptual guidance about when to use particular features, such as using public inheritance to model what are known as
• It illustrates common C++ programming idioms and techniques.
• It provides a variety of sidebars, including tips, cautions, things to remember, compatibility notes, and real-world notes.
The author and editors of this book do our best to keep the presentation to-the-point, simple, and fun. Our goal is that by the end of the book, you’ll be able to write solid, effective programs and enjoy yourself doing so.
Sample Code Used in This Book