Introduction
o Object-Oriented Programming
o Characteristics of Object-Oriented Languages
o C++ and C
o Laying the Groundwork
o The Unified Modeling Language (UML)
C++ Programming Basics
o Basic Program Construction
o Output Using cout
o Directives
o Comments
o Integer Variables
o Character Variables
o Input with cin
o Floating Point Types
o Type bool
o The setw Manipulator
o Variable Type Summary
o Type Conversion
o Arithmetic Operators
o Library Functions
Loops and Decisions
o Loops
o Decisions
o Logical Operators
o Precedence Summary
o Other Control Statements
Structures
o Structures
o Enumerations
Functions
o Simple Functions
o Passing Arguments to Functions
o Returning Values from Functions
o Reference Arguments
o Overloaded Functions
o Recursion
o Inline Functions
o Default Arguments
o Scope and Storage Class
o Returning by Reference
Objects and Classes
o A Simple Class
o C++ Objects as Physical Objects
o C++ Objects as Data Types
o Constructors
o Objects as Function Arguments
o The Default Copy Constructor
o Returning Objects from Functions
o A Card-Game Example
o Structures and Classes
o Classes, Objects, and Memory
o Static Class Data
o const and Classes
Arrays and Strings
o Array Fundamentals
o Arrays as Class Member Data
o Arrays of Objects
o C-Strings
o The Standard C++ string Class
Operator Overloading
o Overloading Unary Operators
o Overloading Binary Operators
o Data Conversion
o UML Class Diagrams
o Pitfalls of Operator Overloading and Conversion
o Keywords explicit and mutable
Inheritance
o Derived Class and Base Class
o Overriding Member Functions
o Which Function Is Used?
o Inheritance in the English Distance Class
o Class Hierarchies
o Inheritance and Graphics Shapes
o Levels of Inheritance
o Multiple Inheritance
o private Derivation in EMPMULT
o Aggregation: Classes Within Classes
o Inheritance and Program Development
Pointers
o Addresses and Pointers
o The Address-of Operator & .
o Pointers and Arrays
o Pointers and Functions
o Pointers and C-Type Strings
o Memory Management: new and delete
o Pointers to Objects
o A Linked List Example
o Pointers to Pointers
o A Parsing Example
o Simulation: A Horse Race
o UML State Diagrams
o Debugging Pointers
Virtual Functions
o Virtual Functions
o Friend Functions
o Static Functions
o Assignment and Copy Initialization
o The this Pointer
o Dynamic Type Information
Streams and Files
o Stream Classes
o Stream Errors
o Disk File I/O with Streams
o File Pointers
o Error Handling in File I/O
o File I/O with Member Functions
o Overloading the Extraction and Insertion Operators
o Memory as a Stream Object
o Command-Line Arguments
o Printer Outpu
Multifile Programs
o Reasons for Multifile Programs
o Creating a Multifile Program
o Inter-File Communication
o A Very Long Number Class
o A High-Rise Elevator Simulation
Templates and Exceptions
o Function Templates
o Class Templates
o Exceptions
The Standard Template Library
o Introduction to the STL
o Algorithms
o Sequence Containers
o Iterators
o Specialized Iterators
o Associative Containers
o Storing User-Defined Objects
o Function Objects
Object-Oriented Software Development
o Evolution of the Software Development Processes
o Use Case Modeling
o The Programming Problem
o The Elaboration Phase for the LANDLORD Program
o From Use Cases to Classes
o Writing the Code
o Interacting with the Program
o Final Thoughts
ASCII Chart
C++ Precedence Table and Keywords
o Precedence Table
o Keywords
Microsoft Visual C++
o Screen Elements
o Single-File Programs
o Multifile Programs
o Building Console Graphics Lite Programs
o Debugging
Borland C++Builder
o Running the Example Programs in C++Builder
o Cleaning Up the Screen
o Creating a New Project
o Naming and Saving a Project
o Starting with Existing Files
o Compiling, Linking, and Executing
o Adding a Header File to Your Project
o Projects with Multiple Source Files
o Console Graphics Lite Programs
o Debugging
Console Graphics Lite
o Using the Console Graphics Lite Routines
o The Console Graphics Lite Functions
o Implementations of the Console Graphics Lite Functions
o Source Code Listings
STL Algorithms and Member Functions
o Algorithms
o Member Functions
o Iterators