O’Reilly & Associates, 1995. — 545 p.
This handbook is written for people with no previous programming experience, for programmers who know C and want to upgrade their skills to C++, and for those who already know C++ and want to improve their programming style and reliability. This book is devoted to practical C++ programming. It teaches you not only the mechanics of the language, but also style and debugging. The entire life cycle of a program is discussed, including conception, design, writing, debugging, release, documentation, maintenance, and revision.
How This Book Is Organized?
What Is C++? , gives you an overvie ins the basic programming process and gives you enough information to write a very simple programs of C++, describes its history and uses, and explains how the language is organized.
The Basics of Program Writing.Style, discusses programming style.Basic Declarations and Expressions, teaches you to comment a program is covered, as well as how to write clear and simple code. roduces simple C++ statements. Basic variables and the assignment statement are covered in detail along with the arithmetic operators: +, -, *, /, and %.
Arrays, Qualifiers, and Reading Numbers, covers arrays and more complex variables. The shorthand operators ++, --, *=, =, +=, -=, and %= are described.
Decision and Control Statements, explains simple decision statements including if, else and for. The problem of == versus = is discussed.
The Programming Process, takes you through the steps required for creating a simple program, from specification through release. Structured programming, fast prototyping, and debugging are discussed.
More Control Statements, describes additional control statements. Included are while, break, and continue. The switch statement is discussed in detail.
Variable Scope and Functions, introduces local variables, functions, and parameters.
The C++ Preprocessor, describes the C++ preprocessor, which gives you great flexibility in creating code. It also provides a tremendous number of ways for you to screw up. Simple rules that help keep the preprocessor from becoming a problem are described.
Bit Operations, discusses the logical C++ operators that work on bits.
Advanced Types, explains structures and other advanced types. The sizeof operator and the enum type are included.
Simple Classes, introduces the concept of a class. This is one of the more powerful features of C++. Classes allow you to group data and the operations that can be performed on that data into one object.
More on Classes, describes additional operations that can be performed with classes.
Simple Pointers, introduces C++ pointer variables and shows some of their uses.
File Input/Output, describes both buffered and unbuffered input/output (I/O). ASCII and binary files are discussed and you are shown how to construct a simple file. Old C-style I/O operations are also included.
Debugging and Optimization, describes how to debug a program, as well as how to use an interactive debugger. You are shown not only how to debug a program, but also how to write a program so that it is easy to debug. This chapter also describes many optimization techniques to make your programs run faster and more efficiently.
Operator Overloading, explains that C++ allows you to extend the language by defining additional meanings for the language's operators. In this chapter, you create a complex type and the operators that work on it.
Floating Point, uses a simple decimal floating-point format to introduce the problems inherent in using floating points, such as roundoff errors, precision loss, overflow, and underflow.
Advanced Pointers, describes advanced use of pointers to construct dynamic structures such as linked lists and trees.
Advanced Classes, shows how to build complex, derived classes out of simple, base ones.
Exceptions, explains how to handle unexpected conditions within a program.
Modular Programming, shows how to split a program into several files and use modular programming techniques. The make utility is explained in more detail.
Templates, allows you to define a generic function or class that generates a family of functions.
Portability Problems, describes the problems that can occur when porting a program (moving a program from one machine to another).
Putting It All Together, details the steps necessary to take a complex program from conception to completion. Information hiding and modular programming techniques, as well as object-oriented programming, are stressed.
From C to C++, describes how to turn C code into C++ code, and addresses many of the traps lurking in C code that bite the C++ programmer.
C++'s Dustier Corners, describes the do/while statement, the comma operator, and the? : operators.
Programming Adages, lists programming adages that will help you construct good C++ programs.
Appendix A,
ASCII Table, contains a list of character codes and their values.
Appendix B,
Ranges, lists the numeric ranges of some C++ variable types.
Appendix C,
Operator Precedence Rules, lists the rules that determine the order in which
operators are evaluated.
Appendix D,
Computing sine Using a Power Series, contains a program that shows how the
computer can compute the value of the sine function.
Starting with Chapter
Simple Classes, you will begin to learn entirely new concepts. Classes are unique to C++ and are one of the more powerful features of the language.