Home > Store > Programming > C/C++

C++ Distilled: A Concise ANSI/ISO Reference and Style Guide

Register your product to gain access to bonus material or receive a coupon.

C++ Distilled: A Concise ANSI/ISO Reference and Style Guide

Book

  • Your Price: $19.99
  • List Price: $24.99
  • Available on demand.

Description

  • Copyright 1997
  • Dimensions: 7-3/8x9-1/4
  • Pages: 224
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-69587-1
  • ISBN-13: 978-0-201-69587-8

In C++ Distilled, veteran educator and programmer Ira Pohl condenses 700 pages of proposed ANSI standard into a concise road map to C++. Selecting the most important and commonly used language elements, Pohl provides syntax, semantics, and examples, as well as style tips that he has distilled from over two decades of programming experience. C++ Distilled is a quick and handy reference to the most recent additions to the language, many of which have yet to be covered in any other book on C++.

Features
  • Covers the important new features of the language such as STL, namespaces, RTTI, and the bool type.
  • Special STL section offers reference and example items for this powerful new library, including a description of the string library.
  • Distills Pohl's extensive experience into effective programming tips.
  • Allows programmers to quickly review syntax and semantics they may not have recently used.
  • Provides code for all example programs covered in the book, as well as adjunct programs that illustrate points made in the book.


0201695871B04062001

Sample Content

Table of Contents



Preface.


1. Program Structure.


2. Lexical Elements.

Comments.

Identifiers.

Keywords.



3. Constants.


4. Declarations and Scope Rules.

Namespaces.



5. Linkage Rules.


6. Types.


7. Conversion Rules and Casts.


8. Expressions and Operators.

sizeof Expressions.

Autoincrement and Autodecrement Expressions.

Arithmetic Expressions.

Relational, Equality, and Logical Expressions.

Assignment Expressions.

Comma Expressions.

Conditional Expressions.

Bit Manipulation Expressions.

Address and Indirection Expressions.

new and delete Expressions.

Other Expressions.



9. Statements.

Expression Statements.

The Compound Statement.

The if and if-else Statements.

The while Statement.

The for Statement.

The do Statement.

The break and continue Statements.

The switch Statement.

The goto Statement.

The return Statement.

The Declaration Statement.



10. Functions.

Prototypes.

Call-by-Reference.

Inline Functions.

Default Arguments.

Overloading.

Type-Safe Linkage for Functions.



11. Classes.

Constructors and Destructors.

Member Functions.

Friend Functions.

The this Pointer.

Operator Overloading.

static and const Member Functions.

Mutable.

Class Design.



12. Inheritance.

Multiple Inheritance.

Constructor Invocation.

Abstract Base Classes.

Pointer to Class Member.

Run-Time Type Identification.

Virtual Functions.



13. Templates.

Template Parameters.

Function Template.

Friends.

Static Members.

Specialization.



14. Exceptions.

Throwing Exceptions.

Try Blocks.

Handlers.

Exception Specification.

terminate() and unexpected().

Standard Library Exceptions.



15. Input/Output.

The Output Class ostream.

Formatted Output and iomanip.h.

User-Defined Types: Output.

The Input Class istream.

Files.

Using Strings as Streams.

The Functions and Macros in ctype.h.

Using Stream States.

Mixing I/O Libraries.



16. STL.

Containers.

Iterators.

Algorithms.

Functions.

Allocators.



17. String Library.

Constructors.

Member Functions.

Global Operators.



18. Caution and Compatibility.

Nested Class Declarations.

Type Compatibilities.

Miscellaneous.



19. New Features in C++.


20. References.


Index. 0201695871T04062001

Preface

C++ Distilled: A Concise ANSI/ISO Reference and Style Guide is a companion volume for the student or professional programmer who uses ANSI C++, including the I/O, and STL library. It supplements and brings up-to-date existing literature.

This book is a concise road map and style guide to C++. It selectively previews the proposed ANSI standard C++ language and includes many programming tips. It is easily used with any C++ programming book (see Chapter 20, "References," on page 189, for a selection), but is especially suitable when used with one of the author's books, such as Object-Oriented Programming Using C++, 2nd Edition (reference OPUS 97).

Each section has the syntax, semantics, and examples of the language element. There are style and programming tips at the end of most sections. Examples have a consistent professional style to be mimicked by programmers.

This book is a distillation of the ANSI standard, which is approximately 700 detailed technically dense pages, and rather overwhelming. Fortunately most programmers do not need such detail; indeed, many of the features are highly specialized and little used. Most programmers need to be able to quickly review some syntax or semantics they have not recently used.

C++ has had many recent additions, including STL, namespaces, RTTI, and the bool type. These can be used readily by someone already proficient in basic C++, but most books have yet to treat these topics. This book can provide a handy guide to these new constructs.

The examples both within the book are intended to exhibit good programming style. Most programming is done in my imitation of existing code and idioms. These examples use my prescriptions and programming tips ("Dr. P's Prescriptions") which are a distillation of considerable professional practice.

The Addison-Wesley web site contains the programs in this book as well as adjunct programs that illustrate the points made in the book or flesh out short pieces of programs. The programs available at the web site are introduced by their .cpp or .h names.

Example Program

 In file hello1.cpp 

//Traditional first program
#include
int main()
{
cout << "HELLO WORLD!" << endl;
}

Dr. P's Prescriptions: Style and Rule Tips

  • Use the style found in this book.
  • Be consistent with whatever style you choose.

Prescription Discussion

Style emphasizes clarity and community norms. Consistency, while the hobgoblin of small minds, is well suited to large computer codes.

Acknowledgments

This book was developed with the support of my editor J. Carter Shanklin, editorial assistant Angela Buenning, and production coordinator Pamela Yee. Thanks also to reviewers Ed Lansinger of General Motors Corporation; Henry A. Etlinger of Rochester Institute of Technology; Glen Deen of Deen Publications, Inc.; Michael Keenan of Columbus State University; and David Gregory. Most importantly, I thank Debra Dolsberry for her invaluable help in the technical editing of this book, and her careful testing of the code.



0201695871P04062001

Updates

Errata

Click below for Errata related to this title:
Updates and Explanations

Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership