CART

(0) items

C++ How to Program,9780131857575
This item qualifies for
FREE SHIPPING!

FREE SHIPPING OVER $59!

Your order must be $59 or more, you must select US Postal Service Shipping as your shipping preference, and the "Group my items into as few shipments as possible" option when you place your order.

Bulk sales, PO's, Marketplace Items, eBooks, Apparel, and DVDs not included.

C++ How to Program

by
Edition:
5th
ISBN13:

9780131857575

ISBN10:
0131857576
Format:
Paperback
Pub. Date:
1/1/2006
Publisher(s):
Prentice Hall
List Price: $118.00

Buy New Textbook

Currently Available, Usually Ships in 24-48 Hours
N9780131857575
$115.05

Rent Textbook

We're Sorry
Sold Out

Used Textbook

We're Sorry
Sold Out

eTextbook

We're Sorry
Not Available

More New and Used
from Private Sellers
Starting at $6.86
See Prices

Questions About This Book?

What version or edition is this?
This is the 5th edition with a publication date of 1/1/2006.
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 CDs, lab manuals, study guides, etc.

Related Products


  • C++ How to Program
    C++ How to Program
  • C++ How to Program
    C++ How to Program
  • C++ How to Program (Early Objects Version)
    C++ How to Program (Early Objects Version)
  • C++ How to Program : Late Objects Version
    C++ How to Program : Late Objects Version
  • C++ HOW TO PROGRAM, 8/e
    C++ HOW TO PROGRAM, 8/e




Summary

With over 250,000 sold, Harvey and Paul Deitel'sC++ How to Programis the world's best-selling introduction to C++ programming. Now, this classic has been thoroughly updated! The Deitels' groundbreaking How to Program series offers unparalleled breadth and depth of programming concepts and intermediate-level topics for further study. The books in this series feature hundreds of complete, working programs with thousands of lines of code.Deitels'C++ How to Programis the most comprehensive, practical introduction to C++ ever published-with hundreds of hands-on exercises, roughly 250 complete programs written and documented for easy learning, and exceptional insight into good programming practices, maximizing performance, avoiding errors, debugging, and testing. The updated Fifth Edition now includes a new early classes pedagogy-classes and objects are introduced in Chapter 3 and used throughout the book as appropriate. The new edition uses string and vector classes to make earlier examples more object-oriented. Large chapters are broken down into smaller, more manageable pieces. A new OOD/UML ATM case study replaces the elevator case study of previous editions, and UML in the OOD/UML case study and elsewhere in the book has been upgraded to UML 2. The Fifth Edition features new mini case studies (e.g., GradeBook and Time classes). An employee hierarchy replaces Point/Circle/Cylinder to introduce inheritance and polymorphism. Additional enhancements include tuned treatment of exception handling, new "Using the Debugger" material and a new "Before You Begin" section to help readers get set up properly. Also included are separate chapters on recursion and searching/sorting. The Fifth Edition retains every key concept and technique ANSI C++ developers need to master: control statements, functions, arrays, pointers and strings, classes and data abstraction, operator overloading, inheritance, virtual functions, polymorphism, I/O, templates, exception handling, file processing, data structures, and more. It also includes a detailed introduction to Standard Template Library (STL) containers, container adapters, algorithms, and iterators. The accompanying CD-ROM includes all the source code from the book.A valuable reference for programmers and anyone interested in learning the C++ programming language and object-oriented development in C++.

Table of Contents

Preface xxiii
Before You Begin lix
Introduction to Computers, the Internet and World Wide Web
1(35)
Introduction
2(1)
What Is a Computer?
3(1)
Computer Organization
4(1)
Early Operating Systems
5(1)
Personal, Distributed and Client/Server Computing
5(1)
The Internet and the World Wide Web
6(1)
Machine Languages, Assembly Languages and High-Level Languages
6(2)
History of C and C++
8(1)
C++ Standard Library
8(1)
History of Java
9(1)
Fortran, Cobol, Pascal and Ada
10(1)
Basic, Visual Basic, Visual C++, C# and .NET
11(1)
Key Software Trend: Object Technology
11(1)
Typical C++ Development Environment
12(3)
Notes About C++ and C++ How to Program, 5/e
15(1)
Test-Driving a C++ Application
16(6)
Software Engineering Case Study: Introduction to Object Technology and the UML (Required)
22(5)
Wrap-Up
27(1)
Web Resources
27(9)
Introduction to C++ Programming
36(38)
Introduction
37(1)
First Program in C++: Printing a Line of Text
37(4)
Modifying Our First C++ Program
41(1)
Another C++ Program: Adding Integers
42(4)
Memory Concepts
46(2)
Arithmetic
48(3)
Decision Making: Equality and Relational Operators
51(5)
(Optional) Software Engineering Case Study: Examining the ATM Requirements Document
56(9)
Wrap-Up
65(9)
Introduction to Classes and Objects
74(50)
Introduction
75(1)
Classes, Objects, Member Functions and Data Members
75(2)
Overview of the Chapter Examples
77(1)
Defining a Class with a Member Function
77(4)
Defining a Member Function with a Parameter
81(3)
Data Members, set Functions and get Functions
84(7)
Initializing Objects with Constructors
91(4)
Placing a Class in a Separate File for Reusability
95(4)
Separating Interface from Implementation
99(6)
Validating Data with set Functions
105(5)
(Optional) Software Engineering Case Study: Identifying the Classes in the ATM Requirements Document
110(8)
Wrap-Up
118(6)
Control Statements: Part 1
124(61)
Introduction
125(1)
Algorithms
125(1)
Pseudocode
126(1)
Control Structures
127(4)
if Selection Statement
131(1)
if...else Double-Selection Statement
132(5)
while Repetition Statement
137(2)
Formulating Algorithms: Counter-Controlled Repetition
139(6)
Formulating Algorithms: Sentinel-Controlled Repetition
145(11)
Formulating Algorithms: Nested Control Statements
156(5)
Assignment Operators
161(1)
Increment and Decrement Operators
161(4)
(Optional) Software Engineering Case Study: Identifying Class Attributes in the ATM System
165(4)
Wrap-Up
169(16)
Control Statements: Part 2
185(53)
Introduction
186(1)
Essentials of Counter-Controlled Repetition
186(2)
for Repetition Statement
188(5)
Examples Using the for Statement
193(4)
do...while Repetition Statement
197(2)
switch Multiple-Selection Statement
199(10)
break and continue Statements
209(2)
Logical Operators
211(5)
Confusing Equality (==) and Assignment (=) Operators
216(1)
Structured Programming Summary
217(5)
(Optional) Software Engineering Case Study: Identifying Objects' States and Activities in the ATM System
222(4)
Wrap-Up
226(12)
Functions and an Introduction to Recursion
238(88)
Introduction
239(1)
Program Components in C++
240(1)
Math Library Functions
241(2)
Function Definitions with Multiple Parameters
243(5)
Function Prototypes and Argument Coercion
248(2)
C++ Standard Library Header Files
250(2)
Case Study: Random Number Generation
252(6)
Case Study: Game of Chance and Introducing enum
258(4)
Storage Classes
262(3)
Scope Rules
265(3)
Function Call Stack and Activation Records
268(4)
Functions with Empty Parameter Lists
272(1)
Inline Functions
273(2)
References and Reference Parameters
275(5)
Default Arguments
280(2)
Unary Scope Resolution Operator
282(1)
Function Overloading
283(3)
Function Templates
286(2)
Recursion
288(4)
Example Using Recursion: Fibonacci Series
292(3)
Recursion vs. Iteration
295(3)
(Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System
298(7)
Wrap-Up
305(21)
Arrays and Vectors
326(75)
Introduction
327(1)
Arrays
328(1)
Declaring Arrays
329(1)
Examples Using Arrays
330(16)
Passing Arrays to Functions
346(5)
Case Study: Class GradeBook Using an Array to Store Grades
351(7)
Searching Arrays with Linear Search
358(1)
Sorting Arrays with Insertion Sort
359(3)
Multidimensional Arrays
362(3)
Case Study: Class GradeBook Using a Two-Dimensional Array
365(7)
Introduction to C++ Standard Library Class Template vector
372(5)
(Optional) Software Engineering Case Study: Collaboration Among Objects in the ATM System
377(8)
Wrap-Up
385(16)
Pointers and Pointer-Based Strings
401(79)
Introduction
402(1)
Pointer Variable Declarations and Initialization
403(1)
Pointer Operators
404(3)
Passing Arguments to Functions by Reference with Pointers
407(4)
Using const with Pointers
411(7)
Selection Sort Using Pass-by-Reference
418(3)
sizeof Operators
421(3)
Pointer Expressions and Pointer Arithmetic
424(3)
Relationship Between Pointers and Arrays
427(4)
Arrays of Pointers
431(1)
Case Study: Card Shuffling and Dealing Simulation
432(6)
Function Pointers
438(5)
Introduction to Pointer-Based String Processing
443(11)
Fundamentals of Characters and Pointer-Based Strings
444(2)
String Manipulation Functions of the String-Handling Library
446(8)
Wrap-Up
454(26)
Classes: A Deeper Look, Part I
480(43)
Introduction
481(1)
Time Class Case Study
482(5)
Class Scope and Accessing Class Members
487(2)
Separating Interface from Implementation
489(2)
Access Functions and Utility Functions
491(2)
Time Class Case Study: Constructors with Default Arguments
493(6)
Destructors
499(1)
When Constructors and Destructors Are Called
500(3)
Time Class Case Study: A Subtle Trap---Returning a Reference to a private Data Member
503(3)
Default Memberwise Assignment
506(2)
Software Reusability
508(1)
(Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System
509(7)
Wrap-Up
516(7)
Classes: A Deeper Look, Part 2
523(48)
Introduction
524(1)
const (Constant) Objects and const Member Functions
524(10)
Composition: Objects as Members of Classes
534(7)
friend Functions and friend Classes
541(4)
Using the this Pointer
545(5)
Dynamic Memory Management with Operators new and delete
550(2)
static Class Members
552(6)
Data Abstraction and Information Hiding
558(3)
Example: Array Abstract Data Type
559(1)
Example: String Abstract Data Type
560(1)
Example: Queue Abstract Data Type
560(1)
Container Classes and Iterators
561(1)
Proxy Classes
562(3)
Wrap-Up
565(6)
Operator Overloading; String and Array Objects
571(62)
Introduction
572(1)
Fundamentals of Operator Overloading
573(1)
Restrictions on Operator Overloading
574(2)
Operator Functions as Class Members vs. Global Functions
576(1)
Overloading Stream Insertion and Stream Extraction Operators
577(4)
Overloading Unary Operators
581(1)
Overloading Binary Operators
581(1)
Case Study: Array Class
582(12)
Converting between Types
594(1)
Case Study: String Class
595(12)
Overloading ++ and - -
607(2)
Case Study: A Date Class
609(4)
Standard Library Class string
613(4)
explicit Constructors
617(4)
Wrap-Up
621(12)
Object-Oriented Programming: Inheritance
633(53)
Introduction
634(1)
Base Classes and Derived Classes
635(3)
protected Members
638(1)
Relationship between Base Classes and Derived Classes
638(32)
Creating and Using a CommissionEmployee Class
639(5)
Creating a BasePlusCommissionEmployee Class Without Using Inheritance
644(6)
Creating a CommissionEmployee--BasePlusCommissionEmployee Inheritance Hierarchy
650(5)
CommissionEmployee--BasePlusCommissionEmployee Inheritance Hierarchy Using protected Data
655(7)
CommissionEmployee--BasePlusCommissionEmployee Inheritance Hierarchy Using private Data
662(8)
Constructors and Destructors in Derived Classes
670(8)
public, protected and private Inheritance
678(1)
Software Engineering with Inheritance
678(2)
Wrap-Up
680(6)
Object-Oriented Programming: Polymorphism
686(63)
Introduction
687(2)
Polymorphism Examples
689(1)
Relationships Among Objects in an Inheritance Hierarchy
690(17)
Invoking Base-Class Functions from Derived-Class Objects
690(8)
Aiming Derived-Class Pointers at Base-Class Objects
698(1)
Derived-Class Member-Function Calls via Base-Class Pointers
699(2)
Virtual Functions
701(6)
Summary of the Allowed Assignments Between Base-Class and Derived-Class Objects and Pointers
707(1)
Type Fields and switch Statements
707(1)
Abstract Classes and Pure virtual Functions
708(2)
Case Study: Payroll System Using Polymorphism
710(18)
Creating Abstract Base Class Employee
712(3)
Creating Concrete Derived Class SalariedEmployee
715(2)
Creating Concrete Derived Class HourlyEmployee
717(3)
Creating Concrete Derived Class CommissionEmployee
720(2)
Creating Indirect Concrete Derived Class BasePlusCommissionEmployee
722(2)
Demonstrating Polymorphic Processing
724(4)
(Optional) Polymorphism, Virtual Functions and Dynamic Binding ``Under the Hood''
728(4)
Case Study: Payroll System Using Polymorphism and Run-Time Type Information with Downcasting, dynamic_cast, typeid and type_info
732(3)
Virtual Destructors
735(1)
(Optional) Software Engineering Case Study: Incorporating Inheritance into the ATM System
736(8)
Wrap-Up
744(5)
Templates
749(20)
Introduction
750(1)
Function Templates
751(3)
Overloading Function Templates
754(1)
Class Templates
754(7)
Nontype Parameters and Default Types for Class Templates
761(1)
Notes on Templates and Inheritance
762(1)
Notes on Templates and Friends
762(1)
Notes on Templates and static Members
763(1)
Wrap-Up
764(5)
Stream Input/Output
769(41)
Introduction
770(1)
Streams
771(4)
Classic Streams vs. Standard Streams
772(1)
iostream Library Header Files
772(1)
Stream Input/Output Classes and Objects
772(3)
Stream Output
775(1)
Output of char * Variables
775(1)
Character Output using Member Function put
775(1)
Stream Input
776(4)
get and getline Member Functions
777(3)
istream Member Functions peek, putback and ignore
780(1)
Type-Safe I/O
780(1)
Unformatted I/O using read, write and gcount
780(1)
Introduction to Stream Manipulators
781(6)
Integral Stream Base: dec, oct, hex and setbase
782(1)
Floating-Point Precision (precision, setprecision)
783(1)
Field Width (width, setw)
784(2)
User-Defined Output Stream Manipulators
786(1)
Stream Format States and Stream Manipulators
787(10)
Trailing Zeros and Decimal Points (showpoint)
788(1)
Justification (left, right and internal)
789(2)
Padding (fill, setfill)
791(1)
Integral Stream Base (dec, oct, hex, showbase)
792(1)
Floating-Point Numbers; Scientific and Fixed Notation (scientific, fixed)
793(1)
Uppercase/Lowercase Control (uppercase)
793(2)
Specifying Boolean Format (boolalpha)
795(1)
Setting and Resetting the Format State via Member Function flags
796(1)
Stream Error States
797(3)
Tying an Output Stream to an Input Stream
800(1)
Wrap-Up
800(10)
Exception Handling
810(31)
Introduction
811(1)
Exception-Handling Overview
812(1)
Example: Handling an Attempt to Divide by Zero
812(7)
When to Use Exception Handling
819(1)
Rethrowing an Exception
820(1)
Exception Specifications
821(1)
Processing Unexpected Exceptions
822(1)
Stack Unwinding
823(1)
Constructors, Destructors and Exception Handling
824(1)
Exceptions and Inheritance
825(1)
Processing new Failures
825(4)
Class auto_ptr and Dynamic Memory Allocation
829(3)
Standard Library Exception Hierarchy
832(2)
Other Error-Handling Techniques
834(1)
Wrap-Up
834(7)
File Processing
841(42)
Introduction
842(1)
The Data Hierarchy
842(2)
Files and Streams
844(1)
Creating a Sequential File
845(4)
Reading Data from a Sequential File
849(7)
Updating Sequential Files
856(1)
Random-Access Files
856(1)
Creating a Random-Access File
857(5)
Writing Data Randomly to a Random-Access File
862(2)
Reading from a Random-Access File Sequentially
864(3)
Case Study: A Transaction-Processing Program
867(7)
Input/Output of Objects
874(1)
Wrap-Up
874(9)
Class string and String Stream Processing
883(28)
Introduction
884(1)
string Assignment and Concatenation
885(2)
Comparing strings
887(3)
Substrings
890(1)
Swapping strings
891(1)
string Characteristics
892(2)
Finding Strings and Characters in a string
894(2)
Replacing Characters in a string
896(2)
Inserting Characters into a string
898(1)
Conversion to C-Style Pointer-Based char * Strings
899(2)
Iterators
901(1)
String Stream Processing
902(3)
Wrap-Up
905(6)
Web Programming
911(64)
Introduction
912(1)
HTTP Request Types
913(1)
Multitier Architecture
914(1)
Accessing Web Servers
915(1)
Apache HTTP Server
916(1)
Requesting XHTML Documents
917(1)
Introduction to CGI
917(1)
Simple HTTP Transactions
918(2)
Simple CGI Scripts
920(8)
Sending Input to a CGI Script
928(1)
Using XHTML Forms to Send Input
928(10)
Other Headers
938(1)
Case Study: An Interactive Web Page
939(4)
Cookies
943(6)
Server-Side Files
949(5)
Case Study: Shopping Cart
954(15)
Wrap-Up
969(1)
Internet and Web Resources
969(6)
Searching and Sorting
975(23)
Introduction
976(1)
Searching Algorithms
976(6)
Efficiency of Linear Search
976(2)
Binary Search
978(4)
Sorting Algorithms
982(10)
Efficiency of Selection Sort
984(1)
Efficiency of Insertion Sort
985(1)
Merge Sort (A Recursive Implementation)
985(7)
Wrap-Up
992(6)
Data Structures
998(59)
Introduction
999(1)
Self-Referential Classes
1000(1)
Dynamic Memory Allocation and Data Structures
1001(1)
Linked Lists
1001(15)
Stacks
1016(5)
Queues
1021(4)
Trees
1025(8)
Wrap-Up
1033(24)
Bits, Characters, C-Strings and structs
1057(53)
Introduction
1058(1)
Structure Definitions
1058(3)
Initializing Structures
1061(1)
Using Structures with Functions
1061(1)
typedef
1061(1)
Example: High-Performance Card Shuffling and Dealing Simulation
1062(3)
Bitwise Operators
1065(9)
Bit Fields
1074(4)
Character-Handling Library
1078(6)
Pointer-Based String-Conversion Functions
1084(5)
Search Functions of the Pointer-Based String-Handling Library
1089(5)
Memory Functions of the Pointer-Based String-Handling Library
1094(5)
Wrap-Up
1099(11)
Standard Template Library (STL)
1110(90)
Introduction to the Standard Template Library (STL)
1112(12)
Introduction to Containers
1113(4)
Introduction to Iterators
1117(5)
Introduction to Algorithms
1122(2)
Sequence Containers
1124(14)
vector Sequence Container
1125(8)
list Sequence Container
1133(3)
deque Sequence Container
1136(2)
Associative Containers
1138(9)
multiset Associative Container
1139(3)
set Associative Container
1142(1)
multimap Associative Container
1143(2)
map Associative Container
1145(2)
Container Adapters
1147(5)
stack Adapter
1147(2)
queue Adapter
1149(2)
priority_queue Adapter
1151(1)
Algorithms
1152(31)
fill, fill_n, generate and generate_n
1153(1)
equal, mismatch and lexicographical_compare
1154(3)
remove, remove_if, remove_copy and remove_copy_if
1157(2)
replace, replace_if, replace_copy and replace_copy_if
1159(3)
Mathematical Algorithms
1162(3)
Basic Searching and Sorting Algorithms
1165(2)
swap, iter_swap and swap_ranges
1167(2)
copy_backward, merge, unique and reverse
1169(2)
inplace_merge, unique_copy and reverse_copy
1171(2)
Set Operations
1173(3)
lower_bound, upper_bound and equal_range
1176(2)
Heapsort
1178(3)
min and max
1181(1)
STL Algorithms Not Covered in This Chapter
1181(2)
Class bitset
1183(4)
Function Objects
1187(3)
Wrap-Up
1190(1)
STL Internet and Web Resources
1191(9)
Other Topics
1200(28)
Introduction
1201(1)
const_cast Operator
1201(2)
namespaces
1203(4)
Operator Keywords
1207(2)
mutable Class Members
1209(2)
Pointers to Class Members (.* and ->*)
1211(2)
Multiple Inheritance
1213(5)
Multiple Inheritance and virtual Base Classes
1218(4)
Wrap-Up
1222(1)
Closing Remarks
1223(5)
A Operator Precedence and Associativity Chart
1228(3)
Operator Precedence
1228(3)
B ASCII Character Set
1231(1)
C Fundamental Types
1232(2)
D Number Systems
1234(13)
Introduction
1235(3)
Abbreviating Binary Numbers as Octal and Hexadecimal Numbers
1238(1)
Converting Octal and Hexadecimal Numbers to Binary Numbers
1239(1)
Converting from Binary, Octal or Hexadecimal to Decimal
1239(1)
Converting from Decimal to Binary, Octal or Hexadecimal
1240(2)
Negative Binary Numbers: Two's Complement Notation
1242(5)
E C Legacy Code Topics
1247(25)
Introduction
1248(1)
Redirecting Input/Output on UNIX/Linux/Mac OS X and Windows Systems
1248(1)
Variable-Length Argument Lists
1249(3)
Using Command-Line Arguments
1252(1)
Notes on Compiling Multiple-Source-File Programs
1253(2)
Program Termination with exit and atexit
1255(2)
The volatile Type Qualifier
1257(1)
Suffixes for Integer and Floating-Point Constants
1257(1)
Signal Handling
1257(3)
Dynamic Memory Allocation with calloc and realloc
1260(1)
The Unconditional Branch: goto
1261(1)
Unions
1262(3)
Linkage Specifications
1265(1)
Wrap-Up
1266(6)
F Preprocessor
1272(13)
Introduction
1273(1)
The #include Preprocessor Directive
1273(1)
The #define Preprocessor Directive: Symbolic Constants
1274(1)
The #define Preprocessor Directive: Macros
1275(2)
Conditional Compilation
1277(1)
The #error and #pragma Preprocessor Directives
1278(1)
The # and ## Operators
1278(1)
Predefined Symbolic Constants
1279(1)
Assertions
1279(1)
Wrap-Up
1280(5)
G ATM Case Study Code
1285(33)
ATM Case Study Implementation
1285(1)
Class ATM
1286(7)
Class Screen
1293(1)
Class Keypad
1294(1)
Class CashDispenser
1295(2)
Class DepositSlot
1297(1)
Class Account
1298(2)
Class BankDatabase
1300(4)
Class Transaction
1304(2)
Class BalanceInquiry
1306(2)
Class Withdrawal
1308(5)
Class Deposit
1313(3)
Test Program ATMCaseStudy.cpp
1316(1)
Wrap-Up
1317(1)
H UML 2: Additional Diagram Types
1318(2)
Introduction
1318(1)
Additional Diagram Types
1318(2)
I C++ Internet and Web Resources
1320(5)
Resources
1320(2)
Tutorials
1322(1)
FAQs
1322(1)
Visual C++
1322(1)
Newsgroups
1323(1)
Compilers and Development Tools
1323(1)
Standard Template Library
1324(1)
J Introduction to XHTML
1325(38)
Introduction
1326(1)
Editing XHTML
1326(1)
First XHTML Example
1327(3)
Headers
1330(1)
Linking
1331(2)
Images
1333(5)
Special Characters and More Line Breaks
1338(2)
Unordered Lists
1340(1)
Nested and Ordered Lists
1340(1)
Basic XHTML Tables
1341(5)
Intermediate XHTML Tables and Formatting
1346(3)
Basic XHTML Forms
1349(3)
More Complex XHTML Forms
1352(7)
Internet and World Wide Web Resources
1359(4)
K XHTML Special Characters
1363(1)
L Using the Visual Studio® .NET Debugger
1364(17)
Introduction
1365(1)
Breakpoints and the Continue Command
1365(6)
The Locals and Watch Windows
1371(3)
Controlling Execution Using the Step Into, Step Over, Step Out and Continue Commands
1374(3)
The Autos Window
1377(1)
Wrap-Up
1378(3)
M Using the GNU™ C++ Debugger
1381(18)
Introduction
1382(1)
Breakpoints and the run, stop, continue and print Commands
1382(7)
The print and set Commands
1389(2)
Controlling Execution Using the step, finish and next Commands
1391(2)
The watch Command
1393(3)
Wrap-Up
1396(1)
Summary
1397(2)
Bibliography 1399(6)
Index 1405


Please wait while the item is added to your cart...