Core C++ A Software Engineering Approach | Victor Shtern

Computer Programming and IT Books
Click Here To Download Book
Pages 1189
Views 10903
Size 3.9 MB
Download 273
Table Of Contents

How Is This Different from Other C++ Books?

Who This Book Is For

How This Book Is Organized

Conventions Used in This Book

Accessing the Source Code



Part I: Introduction to Programming with C++

Chapter 1. Object-oriented approach: What’s So Good About It?

The Origins of the Software Crisis

Remedy 1: Eliminating Programmers

Remedy 2: Improved Management Techniques

Remedy 3: Designing a Complex and Verbose Language

The Object-Oriented Approach: Are We Getting Something for Nothing?

Characteristics of the C++ Programming Language


Chapter 2. Getting Started Quickly: A Brief Overview of C++

The Basic Program Structure

Preprocessor Directives


Declarations and Definitions

Statements and Expressions

Functions and Function Calls


Dealing with Program Development Tools


Chapter 3. Working with C++ Data and Expressions

Values and Their Types

Integral Types

Floating Point Types

Working with C++ Expressions

Mixed Expressions: Hidden Dangers


Chapter 4. C++ Control Flow

Statements and Expressions

Conditional Statements


C++ Jump Statements


Chapter 5. Aggregation with Programmer-Defined Data Types

Arrays as Homogeneous Aggregates

Structures as Heterogeneous Aggregates

Unions, Enumerations, and Bit Fields


Chapter 6. Memory Management: the Stack and the Heap

Name Scope as a Tool for Cooperation

Memory Management: Storage Classes

Memory Management: Using Heap

Input and Output with Disk Files


Part II: Object-oriented programing with C++

Chapter 7. Programming With C++ Functions

C++ Functions as Modularization Tools

Argument Promotions and Conversions

Parameter Passing in C++

Inline Functions

Parameters with Default Values

Function Name Overloading


Chapter 8. Object-Oriented Programming with Functions



Data Encapsulation

Information Hiding

A Larger Example of Encapsulation

Shortcomings of Encapsulation with Functions


Chapter 9. C++ Class as a Unit of Modularization

Basic Class Syntax

Binding Together Data and Operations

Elimination of Name Conflicts

Implementing Member Functions Outside of Class

Defining Class Objects of Different Storage Classes

Controlling Access to Class Members

Initialization of Object Instances

Constructors as Member Functions

Default Constructors

Copy Constructors

Conversion Constructors


Timing of Constructor and Destructor Invocations

Class Scope and the Overriding of Names in Nested Scopes

Memory Management with Operators and Function Calls

Using Returned Objects in Client Code

More on the constKeyword

Static Class Members


Chapter 10. Operator Functions: Another Good idea

Overloading of Operators

Limitations on Operator Overloading

Overloaded Operators as Class Members

Case Study: Rational Numbers

Mixed Types as Parameters

Friend Functions


Chapter 11. Constructors and Destructors: Potential Trouble

More on Passing Objects by Value

Operator Overloading for Nonnumeric Classes

More on the Copy Constructor

Overloading the Assignment Operator

Practical Considerations: What to Implement


Part III: Object-Oriented Programming with Aggregation and Inheritance

Chapter 12. Composite Classes: Pitfalls and Advantages

Using Class Objects as Data Members

Initialization of Composite Objects

Data Members with Special Properties

Container Classes


Chapter 13. Similar Classes: How to Treat Them

Treating Similar Classes

Syntax of C++ Inheritance

Accessing Base and Derived Class Services

Accessing Base Components of a Derived Class Object

Scope Rules and Name Resolution Under Inheritance

Constructors and Destructors for Derived Classes


Chapter 14. Choosing between Inheritance and Composition

Choosing a Technique for Code Reuse

Unified Modeling Language

Case Study: A Rental Store

On Class Visibility and Division of Responsibilities


Part IV: Advanced uses of C++

Chapter 15. Virtual Functions and other Advanced Uses of Inheritance

Conversions Between Nonrelated Classes

Conversions Between Classes Related Through Inheritance

Virtual Functions: Yet Another New Idea

Multiple Inheritance: Several Base Classes


Chapter 16. Advanced Uses of Operator Overloading

Operator Overloading: A Brief Overview

Unary Operators

Subscript and Function Call Operators

Input/Output Operators


Chapter 17. Templates: Yet Another Design Tool

A Simple Example of a Class Design Reuse

Syntax of Template Class Definition

Template Classes with Several Parameters

Relations Between Instantiations of Template Classes

Template Specializations

Template Functions


Chapter 18. Programming with Exceptions

A Simple Example of Exception Processing

Syntax of C++ Exceptions

Exceptions with Class Objects

Type Cast Operators


Chapter 19. What We Have Learned

C++ as a Traditional Programming Language

C++ as a Modular Language

C++ as an Object-Oriented Language

C++ and Competition