About the Book
The fourth edition presents
the ANSI C++ standard beginning with a discussion of the essential elements
of C++ programming: loops, expressions, functions, and classes. It walks
readers through the basics of object-oriented programming: classes, inheritance,
templates, and exceptions, as well as the latest object-oriented programming
techniques. C++ Primer Plus contains hundreds of sample programs. The friendly
tone, concise programs, and end-of-chapter review exercises allow beginners
to write their own programs immediately.
Related
Books
Primer Plus Books (Primer
Plus Books)
Table of Contents
1. Getting Started.
Learning C++.
A Little History.
Portability and Standards.
The Mechanics of Creating a Program.
Conventions Used in This Book.
Our System.
2. Setting Out to C++.
C++ Initiation.
More About C++ Statements.
More C++ Statements.
Functions.
Summary.
Review Questions.
Programming Exercises.
3. Dealing with Data.
Simple Variables.
The const Qualifier.
Floating-Point Numbers.
C++ Arithmetic Operators.
Summary.
Review Questions.
Programming Exercises.
4. Compound Types.
Introducing Arrays.
Strings.
Introducing Structures.
Unions.
Enumerations.
Pointers and the Free Store.
Pointers, Arrays, and Pointer Arithmetic.
Summary.
Review Questions.
Programming Exercises.
5. Loops and Relational Expressions.
Introducing the for Loop.
Relational Expressions.
The while Loop.
The do while Loop.
Loops and Text Input.
Nested Loops and Two-Dimensional Arrays.
Summary.
Review Questions.
Programming Exercises
6. Branching Statements and Logical
Operators.
The if Statement.
Logical Expressions.
The cctype Library of Character Functions.
The ?: Operator.
The switch Statement.
The break and continue Statements.
Number-Reading Loops.
Summary.
Review Questions.
Programming Exercises.
7. Functions-C++'s Programming Modules.
Function Review.
Function Arguments and Passing by
Value.
Functions and Arrays.
Functions and Two-Dimensional Arrays.
Functions and C-Style Strings.
Functions and Structures.
Recursion. Pointers to Functions.
Summary.
Review Questions.
Programming Exercises.
8. Adventures in Functions
Inline Functions.
Reference Variables.
Default Arguments.
Function Polymorphism (Function Overloading).
Function Templates.
Summary.
Review Questions.
Programming Exercises.
9. Memory Models and Namespaces.
Separate Compilation.
Storage Duration, Scope, and Linkage.
Namespaces.
Summary.
Review Questions.
Programming Exercises.
10. Objects and Classes.
Procedural and Object-Oriented Programming.
Abstraction and Classes.
Class Constructors and Destructors.
Knowing Your Objects: The this Pointer.
An Array of Objects.
Class Scope.
An Abstract Data Type.
Summary.
Review Questions.
Programming Exercises.
11. Working with Classes.
Operator Overloading.
Time on Our Hands.
Introducing Friends.
Overloaded Operators: Member Versus
Nonmember Functions.
More Overloading: A Vector Class.
Automatic Conversions and Type Casts
for Classes.
Summary.
Review Questions.
Programming Exercises.
12. Classes and Dynamic Memory Allocation.
Dynamic Memory and Classes.
A Queue Simulation.
Summary.
Review Questions.
Programming Exercises.
13. Class Inheritance.
Beginning with a Simple Base Class.
Special Relationships.
Inheritance-An Is-a Relationship.
Polymorphic Public Inheritance.
Access Control-protected.
Abstract Base Classes.
Inheritance and Dynamic Memory Allocation.
Class Design Review.
Summary.
Review Questions.
Programming Exercises.
14. Reusing Code in C++
Classes with Object Members.
Private Inheritance.
Multiple Inheritance.
Class Templates.
Summary.
Review Questions.
Programming Exercises.
15. Friends, Exceptions, and More.
Friends.
Nested Classes.
Exceptions.
RTTI.
Type Cast Operators.
Summary.
Review Questions.
Programming Exercises.
16. The string Class and the Standard
Template Library.
The string Class.
The auto_ptr Class.
The Standard Template Library.
Generic Programming.
Function Objects (aka Functors).
Algorithms.
Other Libraries.
Summary.
Review Questions.
Programming Exercises.
17. Input, Output, and Files.
An Overview of C++ Input and Output.
Output with cout.
Input with cin.
File Input and Output. Incore Formatting.
What Now?
Summary.
Review Questions.
Programming Exercises.
Appendix A. Number Bases.
Appendix B. C++ Keywords.
Appendix C. The ASCII Character
Set.
Appendix D. Operator Precedence.
Appendix E. Other Operators.
Appendix F. The string Template
Class.
Appendix G. The STL Methods and
Functions.
Appendix H. Selected Readings.
Appendix I. Converting to ANSI/ISO
Standard C++.
Appendix J. Answers to Review Questions.
Index. |