Buying Options
Practical C++ Programming, Second Edition
Print $39.95
Add to Cart
Print+Ebook $43.95
Add to Cart
Ebook $31.99
(PDF)
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £30.50
Add to Cart
What is this?

Product Editions

  1. Practical C++ Programming, Second Edition - December 2002
  2. Practical C++ Programming - August 1995 (out of print)
Description
In short, to-the-point chapters, Practical C++ Programming covers all aspects of programming including style, software engineering, programming design, object-oriented design, and debugging. It also covers common mistakes and how to find (and avoid) them. End of chapter exercises help you ensure you've mastered the material. Steve Oualline's clear, easy-going writing style and hands-on approach to learning make Practical C++ Programming a nearly painless way to master this complex but powerful programming language.
Full Description
Table of Contents
  1. The Basics

    1. Chapter 1 What Is C++?

      1. A Brief History of C++
      2. C++ Organization
      3. How to Learn C++
    2. Chapter 2 The Basics of Program Writing

      1. Programs from Conception to Execution
      2. Creating a Real Program
      3. Getting Help in Unix
      4. Getting Help in an IDE
      5. Programming Exercises
    3. Chapter 3 Style

      1. Comments
      2. C++ Code
      3. Naming Style
      4. Coding Religion
      5. Indentation and Code Format
      6. Clarity
      7. Simplicity
      8. Consistency and Organization
      9. Further Reading
      10. Summary
    4. Chapter 4 Basic Declarations and Expressions

      1. Basic Program Structure
      2. Simple Expressions
      3. The std::cout Output Object
      4. Variables and Storage
      5. Variable Declarations
      6. Integers
      7. Assignment Statements
      8. Floating-Point Numbers
      9. Floating-Point Divide Versus Integer Divide
      10. Characters
      11. Wide Characters
      12. Boolean Type
      13. Programming Exercises
      14. Answers to Chapter Questions
    5. Chapter 5 Arrays, Qualifiers, and Reading Numbers

      1. Arrays
      2. Strings
      3. Reading Data
      4. Initializing Variables
      5. Multidimensional Arrays
      6. C-Style Strings
      7. Types of Integers
      8. Types of Floats
      9. Constant and Reference Declarations
      10. Qualifiers
      11. Hexadecimal and Octal Constants
      12. Operators for Performing Shortcuts
      13. Side Effects
      14. Programming Exercises
      15. Answers to Chapter Questions
    6. Chapter 6 Decision and Control Statements

      1. if Statement
      2. else Statement
      3. How Not to Use std::strcmp
      4. Looping Statements
      5. while Statement
      6. break Statement
      7. continue Statement
      8. The Assignment Anywhere Side Effect
      9. Programming Exercises
      10. Answers to Chapter Questions
    7. Chapter 7 The Programming Process

      1. Setting Up Your Work Area
      2. The Specification
      3. Code Design
      4. The Prototype
      5. The Makefile
      6. Testing
      7. Debugging
      8. Maintenance
      9. Revisions
      10. Electronic Archaeology
      11. Mark Up the Program
      12. Use the Debugger
      13. Use the Text Editor as a Browser
      14. Add Comments
      15. Programming Exercises
  2. Simple Programming

    1. Chapter 8 More Control Statements

      1. for Statement
      2. switch Statement
      3. switch, break, and continue
      4. Programming Exercises
      5. Answers to Chapter Questions
    2. Chapter 9 Variable Scope and Functions

      1. Scope and Storage Class
      2. Namespaces
      3. Functions
      4. Summary of Parameter Types
      5. Recursion
      6. Structured Programming Basics
      7. Real-World Programming
      8. Programming Exercises
      9. Answers to Chapter Questions
    3. Chapter 10 The C++ Preprocessor

      1. #define Statement
      2. Conditional Compilation
      3. #include Files
      4. Parameterized Macros
      5. Advanced Features
      6. Summary
      7. Programming Exercises
      8. Answers to Chapter Questions
    4. Chapter 11 Bit Operations

      1. Bit Operators
      2. The AND Operator (&)
      3. Bitwise OR (|)
      4. The Bitwise Exclusive OR (^)
      5. The Ones Complement Operator (NOT) (~)
      6. The Left and Right Shift Operators (<<, >>)
      7. Setting, Clearing, and Testing Bits
      8. Bitmapped Graphics
      9. Programming Exercises
      10. Answers to Chapter Questions
  3. Advanced Types and Classes

    1. Chapter 12 Advanced Types

      1. Structures
      2. Unions
      3. typedef
      4. enum Type
      5. Bit Members or Packed Structures
      6. Arrays of Structures
      7. Programming Exercises
      8. Answers to Chapter Questions
    2. Chapter 13 Simple Classes

      1. Stacks
      2. Improved Stack
      3. Using a Class
      4. Introduction to Constructors and Destructors
      5. Automatically Generated Member Functions
      6. Shortcuts
      7. Style
      8. Structures Versus Classes
      9. Programming Exercises
    3. Chapter 14 More on Classes

      1. Friends
      2. Constant Functions
      3. Constant Members
      4. Static Member Variables
      5. Static Member Functions
      6. The Meaning of static
      7. Programming Exercises
    4. Chapter 15 Simple Pointers

      1. const Pointers
      2. Pointers and Printing
      3. Pointers and Arrays
      4. The reinterpret_cast
      5. Pointers and Structures
      6. Command-Line Arguments
      7. Programming Exercises
      8. Answers to Chapter Questions
  4. Advanced Programming Concepts

    1. Chapter 16 File Input/Output

      1. C++ File I/O
      2. Conversion Routines
      3. Binary and ASCII Files
      4. The End-of-Line Puzzle
      5. Binary I/O
      6. Buffering Problems
      7. Unbuffered I/O
      8. Designing File Formats
      9. C-Style I/O Routines
      10. C-Style Conversion Routines
      11. C-Style Binary I/O
      12. C- Versus C++- Style I/O
      13. Programming Exercises
      14. Answers to Chapter Questions
    2. Chapter 17 Debugging and Optimization

      1. Code Reviews
      2. Serial Debugging
      3. Going Through the Output
      4. Interactive Debuggers
      5. Debugging a Binary Search
      6. Interactive Debugging Tips and Tricks
      7. Runtime Errors
      8. Optimization
      9. How to Optimize
      10. Case Study: Inline Functions Versus Normal Functions
      11. Case Study: Optimizing a Color-Rendering Algorithm
      12. Programming Exercises
      13. Answers to Chapter Questions
    3. Chapter 18 Operator Overloading

      1. Creating a Simple Fixed-Point Class
      2. Operator Functions
      3. Operator Member Functions
      4. Warts
      5. Full Definition of the Fixed-Point Class
      6. Programming Exercises
      7. Answers to Chapter Questions
    4. Chapter 19 Floating Point

      1. Floating-Point Format
      2. Floating Addition/Subtraction
      3. Multiplication and Division
      4. Overflow and Underflow
      5. Roundoff Error
      6. Accuracy
      7. Minimizing Roundoff Error
      8. Determining Accuracy
      9. Precision and Speed
      10. Power Series
      11. Programming Exercises
    5. Chapter 20 Advanced Pointers

      1. Pointers, Structures, and Classes
      2. delete Operator
      3. Linked Lists
      4. Ordered Linked Lists
      5. Doubly Linked Lists
      6. Trees
      7. Printing a Tree
      8. The Rest of the Program
      9. Data Structures for a Chess Program
      10. Programming Exercises
      11. Answers to Chapter Questions
    6. Chapter 21 Advanced Classes

      1. Derived Classes
      2. Virtual Functions
      3. Virtual Classes
      4. Function Hiding in Derived Classes
      5. Constructors and Destructors in Derived Classes
      6. The dynamic_cast Operator
      7. Summary
      8. Programming Exercises
      9. Answers to Chapter Questions
  5. Other Language Features

    1. Chapter 22 Exceptions

      1. Adding Exceptions to the Stack Class
      2. Exceptions Versus assert
      3. Programming Exercises
    2. Chapter 23 Modular Programming

      1. Modules
      2. Public and Private
      3. The extern Storage Class
      4. Headers
      5. The Body of the Module
      6. A Program to Use Infinite Arrays
      7. The Makefile for Multiple Files
      8. Using the Infinite Array
      9. Dividing a Task into Modules
      10. Module Design Guidelines
      11. Programming Exercises
    3. Chapter 24 Templates

      1. What Is a Template?
      2. Templates: The Hard Way
      3. Templates: The C++ Way
      4. Function Specialization
      5. Class Templates
      6. Class Specialization
      7. Implementation Details
      8. Advanced Features
      9. Summary
      10. Programming Exercises
    4. Chapter 25 Standard Template Library

      1. STL Basics
      2. Class List—A Set of Students
      3. Creating a Waiting List with the STL List
      4. Storing Grades in a STL Map
      5. Putting It All Together
      6. Practical Considerations When Using the STL
      7. Getting More Information
      8. Exercises
    5. Chapter 26 Program Design

      1. Design Goals
      2. Design Factors
      3. Design Principles
      4. Coding
      5. Objects
      6. Real-World Design Techniques
      7. Conclusion
    6. Chapter 27 Putting It All Together

      1. Requirements
      2. Code Design
      3. Coding
      4. Functional Description
      5. Testing
      6. Revisions
      7. A Final Warning
      8. Program Files
      9. Programming Exercises
    7. Chapter 28 From C to C++

      1. K&R-Style Functions
      2. struct
      3. malloc and free
      4. Turning Structures into Classes
      5. setjmp and longjmp
      6. Mixing C and C++ Code
      7. Summary
      8. Programming Exercise
    8. Chapter 29 C++'s Dustier Corners

      1. do/while
      2. goto
      3. The ?: Construct
      4. The Comma Operator
      5. Overloading the ( ) Operator
      6. Pointers to Members
      7. The asm Statement
      8. The mutable Qualifier
      9. Run Time Type Identification
      10. Trigraphs
      11. Answers to Chapter Questions
    9. Chapter 30 Programming Adages

      1. General
      2. Design
      3. Declarations
      4. switch Statement
      5. Preprocessor
      6. Style
      7. Compiling
      8. The Ten Commandments for C++ Programmers
      9. Final Note
      10. Answers to Chapter Questions
  6. Appendixes

    1. Appendix A ASCII Table

    2. Appendix B Ranges

    3. Appendix C Operator Precedence Rules

      1. Standard Rules
      2. Practical Subset of the Operator Precedence Rules
    4. Appendix D Computing Sine Using a Power Series

    5. Appendix E Resources

      1. Compilers
      2. Standard Template Library
      3. Standards
      4. Programming Tools
  1. Colophon

View Full Table of Contents
Product Details
Title:
Practical C++ Programming, Second Edition
By:
Steve Oualline
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
December 2002
Ebook Release:
June 2009
Pages:
576
Print ISBN:
978-0-596-00419-4
| ISBN 10:
0-596-00419-2
Ebook ISBN:
978-0-596-10352-1
| ISBN 10:
0-596-10352-2
Customer Reviews
About the Author
  1. Steve Oualline

    Steve Oualline lives in Southern California, where he works as a software engineer for a major phone company. In his free time he is a real engineer on the Poway Midland Railroad. Steve has written almost a dozen books on programming and Linux software. His web site is http://www.oualline.com .

    View Steve Oualline's full profile page.

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Practical C++ Programming is an Eastern chipmunk, a striped ground squirrel found mostly in eastern North America. Eastern chipmunks have five dark and two light stripes on their backs, extending from head to rump, and two stripes on their long, bushy tails. They are distinguished from other ground squirrels by the white stripes above and below their eyes. The coloration of chipmunks throughout North America varies, but is quite uniform within regions.

Chipmunks often make their homes in sparse forests or farms, where they can build the entrances to their lodges in stone walls, broken trees, or thick underbrush. The lodges consist of a maze of tunnels leading to a large leaf-lined nest. Chipmunks spend most of the daylight hours outdoors, but head for their lodges before nightfall. Although they are excellent climbers, chipmunks live primarily on the ground.

Chipmunks eat nuts, seeds, insects, and occasionally birds' eggs. Like all ground squirrels, they have large cheek pouches, sometimes extending as far back as their shoulders, in which they can store food. They collect and store nuts and seeds through the summer and fall. When the weather starts to get cool, all the chipmunks in a region will suddenly disappear into their lodges where they begin hibernation. On warm winter days one can often see chipmunk pawprints in the snow, as they will sometimes wake up and leave their lodges for brief periods when the temperature rises.

Mating season for Eastern chipmunks is mid-March to early April. The gestation period is 31 days, after which a litter of three to six is born. Baby chipmunks leave the lodge after one month, and are mature by July.

The chipmunk most likely got its name from the noise it makes, which sounds like a loud "cheep." You can occasionally see a chipmunk hanging upside down from a tree branch "cheeping" its call. Edie Freedman designed the cover of this book, using a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with Quark XPress 4.1 using the ITC Garamond font.

David Futato designed the interior layout. Mike Sierra polished the final book files in FrameMaker 5.5.6. Leanne Soylemez copyedited the text. Octal Publishing, Inc., prepared the index. Jane Ellin provided quality control and production guidance.

The text font is Lintotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed.The illustrations that appear in the book were created by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Clairemarie Fisher O'Leary.

  • Book cover of Practical C++ Programming