did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780596004194

Practical C++ Programming

by
  • ISBN13:

    9780596004194

  • ISBN10:

    0596004192

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2002-12-01
  • Publisher: Oreilly & Associates Inc

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.99 Save up to $17.50
  • Rent Book $32.49
    Add to Cart Free Shipping Icon Free Shipping

    TERM
    PRICE
    DUE
    USUALLY SHIPS IN 24-48 HOURS
    *This item is part of an exclusive publisher rental program and requires an additional convenience fee. This fee will be reflected in the shopping cart.

Supplemental Materials

What is included with this book?

Summary

Practical C++ Programming is a complete introduction to the C++ language for programmers who are learning C++ or transitioning from C to C++. In a new edition reflecting the latest changes to the C++ standard, this book takes a practical, real-world approach, placing a strong emphasis on coding style and the programming process. Readers learn not only the syntax of C++, but also how to write clear, maintainable code and to design and debug programs in a systematic way. For a hands-on approach to learning C++, this is the book to recommend.

Author Biography

  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 .

Table of Contents

Preface xv
Part I. The Basics
What Is C++?
3(4)
A Brief History of C++
3(1)
C++ Organization
4(2)
How to Learn C++
6(1)
The Basics of Program Writing
7(16)
Programs from Conception to Execution
9(1)
Creating a Real Program
10(12)
Getting Help in Unix
22(1)
Getting Help in an IDE
22(1)
Programming Exercises
22(1)
Style
23(12)
Comments
24(4)
C++ Code
28(2)
Naming Style
30(1)
Coding Religion
31(1)
Indentation and Code Format
31(1)
Clarity
32(1)
Simplicity
33(1)
Consistency and Organization
34(1)
Further Reading
34(1)
Summary
34(1)
Basic Declarations and Expressions
35(13)
Basic Program Structure
36(1)
Simple Expressions
37(1)
The std::cout Output Object
38(1)
Variables and Storage
39(1)
Variable Declarations
40(1)
Integers
40(1)
Assignment Statements
41(1)
Floating-Point Numbers
42(1)
Floating-Point Divide Versus Integer Divide
43(1)
Characters
44(2)
Wide Characters
46(1)
Boolean Type
46(1)
Programming Exercises
46(1)
Answers to Chapter Questions
47(1)
Arrays, Qualifiers, and Reading Numbers
48(28)
Arrays
48(1)
Strings
49(2)
Reading Data
51(2)
Initializing Variables
53(4)
Multidimensional Arrays
57(1)
C-Style Strings
58(6)
Types of Integers
64(3)
Types of Floats
67(1)
Constant and Reference Declarations
67(1)
Qualifiers
68(2)
Hexadecimal and Octal Constants
70(1)
Operators for Performing Shortcuts
71(1)
Side Effects
72(2)
Programming Exercises
74(1)
Answers to Chapter Questions
75(1)
Decision and Control Statements
76(11)
if Statement
76(1)
else Statement
77(1)
How Not to Use std::strcmp
78(1)
Looping Statements
79(1)
while Statement
79(2)
break Statement
81(1)
continue Statement
82(1)
The Assignment Anywhere Side Effect
83(1)
Programming Exercises
84(1)
Answers to Chapter Questions
85(2)
The Programming Process
87(20)
Setting Up Your Work Area
89(1)
The Specification
90(1)
Code Design
91(1)
The Prototype
92(1)
The Makefile
93(3)
Testing
96(1)
Debugging
96(2)
Maintenance
98(1)
Revisions
99(1)
Electronic Archaeology
99(1)
Mark Up the Program
100(1)
Use the Debugger
100(1)
Use the Text Editor as a Browser
100(1)
Add Comments
101(2)
Programming Exercises
103(4)
Part II. Simple Programming
More Control Statements
107(11)
for Statement
107(3)
switch Statement
110(5)
switch, break, and continue
115(1)
Programming Exercises
115(2)
Answers to Chapter Questions
117(1)
Variable Scope and Functions
118(27)
Scope and Storage Class
118(4)
Namespaces
122(3)
Functions
125(13)
Summary of Parameter Types
138(1)
Recursion
139(2)
Structured Programming Basics
141(1)
Real-World Programming
142(1)
Programming Exercises
142(1)
Answers to Chapter Questions
143(2)
The C++ Preprocessor
145(15)
#define Statement
145(5)
Conditional Compilation
150(2)
#include Files
152(2)
Parameterized Macros
154(2)
Advanced Features
156(1)
Summary
156(1)
Programming Exercises
157(1)
Answers to Chapter Questions
157(3)
Bit Operations
160(19)
Bit Operators
161(1)
The AND Operator (&)
161(2)
Bitwise OR (|)
163(1)
The Bitwise Exclusive OR (^)
164(1)
The Ones Complement Operator (NOT) (~)
164(1)
The Left and Right Shift Operators (<<, >>)
165(1)
Setting, Clearing, and Testing Bits
166(3)
Bitmapped Graphics
169(5)
Programming Exercises
174(1)
Answers to Chapter Questions
175(4)
Part III. Advanced Types and Classes
Advanced Types
179(12)
Structures
179(2)
Unions
181(3)
typedef
184(1)
enum Type
185(1)
Bit Members or Packed Structures
186(2)
Arrays of Structures
188(1)
Programming Exercises
189(1)
Answers to Chapter Questions
189(2)
Simple Classes
191(20)
Stacks
191(4)
Improved Stack
195(2)
Using a Class
197(2)
Introduction to Constructors and Destructors
199(5)
Automatically Generated Member Functions
204(1)
Shortcuts
205(1)
Style
206(2)
Structures Versus Classes
208(1)
Programming Exercises
209(2)
More on Classes
211(10)
Friends
211(2)
Constant Functions
213(2)
Constant Members
215(1)
Static Member Variables
216(2)
Static Member Functions
218(1)
The Meaning of static
218(1)
Programming Exercises
219(2)
Simple Pointers
221(24)
const Pointers
226(1)
Pointers and Printing
226(1)
Pointers and Arrays
227(7)
The reinterpret_cast
234(1)
Pointers and Structures
234(1)
Command-Line Arguments
235(4)
Programming Exercises
239(1)
Answers to Chapter Questions
240(5)
Part IV. Advanced Programming Concepts
File Input/Output
245(32)
C++ File I/O
245(5)
Conversion Routines
250(4)
Binary and ASCII Files
254(1)
The End-of-Line Puzzle
255(1)
Binary I/O
256(1)
Buffering Problems
257(1)
Unbuffered I/O
258(4)
Designing File Formats
262(2)
C-Style I/O Routines
264(2)
C-Style Conversion Routines
266(4)
C-Style Binary I/O
270(2)
C- Versus C++- Style I/O
272(2)
Programming Exercises
274(1)
Answers to Chapter Questions
275(2)
Debugging and Optimization
277(33)
Code Reviews
277(3)
Serial Debugging
280(2)
Going Through the Output
282(1)
Interactive Debuggers
283(4)
Debugging a Binary Search
287(11)
Interactive Debugging Tips and Tricks
298(1)
Runtime Errors
299(2)
Optimization
301(5)
How to Optimize
306(2)
Case Study: Inline Functions Versus Normal Functions
308(1)
Case Study: Optimizing a Color-Rendering Algorithm
308(1)
Programming Exercises
309(1)
Answers to Chapter Questions
309(1)
Operator Overloading
310(27)
Creating a Simple Fixed-Point Class
310(5)
Operator Functions
315(9)
Operator Member Functions
324(2)
Warts
326(1)
Full Definition of the Fixed-Point Class
326(9)
Programming Exercises
335(1)
Answers to Chapter Questions
336(1)
Floating Point
337(10)
Floating-Point Format
337(1)
Floating Addition/Subtraction
338(1)
Multiplication and Division
339(1)
Overflow and Underflow
340(1)
Roundoff Error
340(1)
Accuracy
341(1)
Minimizing Roundoff Error
342(1)
Determining Accuracy
342(1)
Precision and Speed
343(1)
Power Series
344(2)
Programming Exercises
346(1)
Advanced Pointers
347(24)
Pointers, Structures, and Classes
348(2)
delete Operator
350(1)
Linked Lists
351(3)
Ordered Linked Lists
354(3)
Doubly Linked Lists
357(3)
Trees
360(4)
Printing a Tree
364(1)
The Rest of the Program
364(3)
Data Structures for a Chess Program
367(2)
Programming Exercises
369(1)
Answers to Chapter Questions
369(2)
Advanced Classes
371(22)
Derived Classes
371(7)
Virtual Functions
378(5)
Virtual Classes
383(2)
Function Hiding in Derived Classes
385(1)
Constructors and Destructors in Derived Classes
385(3)
The dynamic_cast Operator
388(1)
Summary
389(1)
Programming Exercises
389(1)
Answers to Chapter Questions
390(3)
Part V. Other Language Features
Exceptions
393(8)
Adding Exceptions to the Stack Class
394(6)
Exceptions Versus assert
400(1)
Programming Exercises
400(1)
Modular Programming
401(18)
Modules
401(1)
Public and Private
402(1)
The extern Storage Class
402(2)
Headers
404(2)
The Body of the Module
406(1)
A Program to Use Infinite Arrays
406(2)
The Makefile for Multiple Files
408(4)
Using the Infinite Array
412(5)
Dividing a Task into Modules
417(1)
Module Design Guidelines
417(1)
Programming Exercises
418(1)
Templates
419(13)
What Is a Template?
419(1)
Templates: The Hard Way
419(1)
Templates: The C++ Way
420(3)
Function Specialization
423(1)
Class Templates
424(2)
Class Specialization
426(1)
Implementation Details
426(3)
Advanced Features
429(2)
Summary
431(1)
Programming Exercises
431(1)
Standard Template Library
432(16)
STL Basics
432(2)
Class List---A Set of Students
434(2)
Creating a Waiting List with the STL List
436(1)
Storing Grades in a STL Map
437(1)
Putting It All Together
437(8)
Practical Considerations When Using the STL
445(1)
Getting More Information
446(1)
Exercises
446(2)
Program Design
448(21)
Design Goals
448(1)
Design Factors
449(1)
Design Principles
450(1)
Coding
451(6)
Objects
457(4)
Real-World Design Techniques
461(6)
Conclusion
467(2)
Putting It All Together
469(28)
Requirements
469(2)
Code Design
471(1)
Coding
472(1)
Functional Description
472(5)
Testing
477(1)
Revisions
477(1)
A Final Warning
477(1)
Program Files
477(19)
Programming Exercises
496(1)
From C to C++
497(7)
K&R-Style Functions
497(1)
struct
498(1)
malloc and free
498(2)
Turning Structures into Classes
500(1)
setjmp and longjmp
501(2)
Mixing C and C++ Code
503(1)
Summary
503(1)
Programming Exercise
503(1)
C++'s Dustier Corners
504(6)
do/while
504(1)
goto
504(2)
The ?: Construct
506(1)
The Comma Operator
506(1)
Overloading the () Operator
507(1)
Pointers to Members
507(1)
The asm Statement
508(1)
The mutable Qualifier
508(1)
Run Time Type Identification
509(1)
Trigraphs
509(1)
Answers to Chapter Questions
509(1)
Programming Adages
510(21)
General
510(1)
Design
511(1)
Declarations
511(1)
switch Statement
511(1)
Preprocessor
511(1)
Style
512(1)
Compiling
512(1)
The Ten Commandments for C++ Programmers
512(1)
Final Note
513(1)
Answers to Chapter Questions
514(3)
Part VI. Appendixes
A. ASCII Table
517(2)
B. Ranges
519(2)
C. Operator Precedence Rules
521(2)
D. Computing Sine Using a Power Series
523(6)
E. Resources
529(2)
Index 531

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program