Skip to content

C++ How to Program

Best in textbook rentals since 2012!

ISBN-10: 0132662361

ISBN-13: 9780132662369

Edition: 8th 2012

Authors: Paul Deitel, Harvey Deitel

List price: $141.20
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Customers also bought

Book details

List price: $141.20
Edition: 8th
Copyright year: 2012
Publisher: Prentice Hall PTR
Publication date: 3/15/2011
Binding: Mixed Media
Pages: 1104
Size: 7.00" wide x 9.00" long x 1.25" tall
Weight: 3.036
Language: English

Preface
Introduction to Computers and C++
Introduction
Computers: Hardware and Software
Data Hierarchy
Computer Organization
Machine Languages, Assembly Languages and High-Level Languages
Introduction to Object Technology
Operating Systems
Programming Languages
C++ and a Typical C++ Development Environment
Test-Driving a C++ Application
Web 2.0: Going Social
Software Technologies
Future of C++: TR1, the New C++ Standard and the Open Source Boost Libraries
Keeping Up-to-Date with Information Technologies
Wrap-Up
Introduction to C++ Programming
Introduction
First Program in C++: Printing a Line of Text
Modifying Our First C++ Program
Another C++ Program: Adding Integers
Memory Concepts
Arithmetic
Decision Making: Equality and Relational Operators
Wrap-Up
Introduction to Classes, Objects and Strings
Introduction
Defining a Class with a Member Function
Defining a Member Function with a Parameter
Data Members, set Functions and get Functions
Initializing Objects with Constructors
Placing a Class in a Separate File for Reusability
Separating Interface from Implementation
Validating Data with set Functions
Wrap-Up
Control Statements: Part1
Introduction
Algorithms
Pseudocode
Control Structures
if Selection Statement
if...else Double-Selection Statement
while Repetition Statement
Formulating Algorithms: Counter-Controlled Repetition
Formulating Algorithms: Sentinel-Controlled Repetition
Formulating Algorithms: Nested Control Statements
Assignment Operators
Increment and Decrement Operators
Wrap-Up
Control Statements: Part2
Introduction
Essentials of Counter-Controlled Repetition
for Repetition Statement
Examples Using the for Statement
do...while Repetition Statement
switch Multiple-Selection Statement
break and continue Statements
Logical Operators
Confusing the Equality (==) and Assignment (=) Operators
Structured Programming Summary
Wrap-Up
Functions and an Introduction to Recursion
Introduction
Program Components in C++
Math Library Functions
Function Definitions with Multiple Parameters
Function Prototypes and Argument Coercion
C++ Standard Library Headers
Case Study: Random Number Generation
Case Study: Game of Chance; Introducing enum
Storage Classes
Scope Rules
Function Call Stack and Activation Records
Functions with Empty Parameter Lists
Inline Functions
References and Reference Parameters
Default Arguments
Unary Scope Resolution Operator
Function Overloading
Function Templates
Recursion
Example Using Recursion: Fibonacci Series
Recursion vs. Iteration
Wrap-Up
Arrays and Vectors
Introduction
Arrays
Declaring Arrays
Examples Using Arrays
Declaring an Array and Using a Loop to Initialize the Array's Elements
Initializing an Array in a Declaration with an Initializer List
Specifying an Array's Size with a Constant Variable and Setting Array Elements with Calculations
Summing the Elements of an Array
Using Bar Charts to Display Array Data Graphically
Using the Elements of an Array as Counters
Using Arrays to Summarize Survey Results
Static Local Arrays and Automatic Local Arrays
Passing Arrays to Functions
Case Study: Class GradeBook Using an Array to Store Grades
Searching Arrays with Linear Search
Sorting Arrays with Insertion Sort
Multidimensional Arrays
Case Study: Class GradeBook Using a Two-Dimensional Array
Introduction to C++ Standard Library Class Template vector
Wrap-Up
Pointers
Introduction
Pointer Variable Declarations and Initialization
Pointer Operators
Pass-by-Reference with Pointers
Using const with Pointers
Selection Sort Using Pass-by-Reference
sizeof Operator
Pointer Expressions and Pointer Arithmetic
Relationship Between Pointers and Arrays
Pointer-Based String Processing
Arrays of Pointers
Function Pointers
Wrap-Up
Classes: A Deeper Look, Part1
Introduction
Time Class Case Study
Class Scope and Accessing Class Members
Separating Interface from Implementation
Access Functions and Utility Functions
Time Class Case Study: Constructors with Default Arguments
Destructors
When Constructors and Destructors Are Called
Time Class Case Study: A Subtle Trap-Returning a Reference to a private Data Member
Default Memberwise Assignment
Wrap-Up
Classes: A Deeper Look, Part2
Introduction
const (Constant) Objects and const Member Functions
Composition: Objects as Members of Classes
friend Functions and friend Classes
Using the this Pointer
static Class Members
Proxy Classes
Wrap-Up
Operator Overloading; Class string
Introduction
Using the Overloaded Operators of Standard Library Class string
Fundamentals of Operator Overloading
Overloading Binary Operators
Overloading the Binary Stream Insertion and Stream Extraction Operators
Overloading Unary Operators
Overloading the Unary Prefix and Postfix ++ and -- Operators
Case Study: A Date Class
Dynamic Memory Management
Case Study: Array Class
Using the Array Class
Array Class Definition
Operators as Member Functions vs. Non-Member Functions
Converting between Types
explicit Constructors
Building a String Class
Wrap-Up
Object-Oriented Programming: Inheritance
Introduction
Base Classes and Derived Classes
protected Members
Relationship between Base Classes and Derived Classes
Creating and Using a CommissionEmployee Class
Creating a BasePlusCommissionEmployee Class Without Using Inheritance
Creating a CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy
CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy Using protected Data
CommissionEmployee BasePlusCommissionEmployee Inheritance Hierarchy Using private Data
Constructors and Destructors in Derived Classes
public, protected and private Inheritance
Software Engineering with Inheritance
Wrap-Up
Object-Oriented Programming: Polymorphism
Introduction
Introduction to Polymorphism: Polymorphic Video Game
Relationships Among Objects in an Inheritance Hierarchy
Invoking Base-Class Functions from Derived-Class Objects
Aiming Derived-Class Pointers at Base-Class Objects
Derived-Class Member-Function Calls via Base-Class Pointers
Virtual Functions
Type Fields and switch Statements
Abstract Classes and Pure virtual Functions
Case Study: Payroll System Using Polymorphism
Creating Abstract Base Class Employee
Creating Concrete Derived Class Salaried Employee
Creating Concrete Derived Class Commission Employee
Creating Indirect Concrete Derived Class Base Plus Commission Employee
Demonstrating Polymorphic Processing
(Optional) Polymorphism, Virtual Functions and Dynamic Binding "Under the Hood"
Case Study: Payroll System Using Polymorphism and Runtime Type Information with Downcasting, dynamic_cast, typeid and type_info
Virtual Destructors
Wrap-Up
Templates
Introduction
Function Templates
Overloading Function Templates
Class Templates
Nontype Parameters and Default Types for Class Templates
Wrap-Up
Stream Input/Output
Introduction
Streams
Classic Streams vs. Standard Streams
iostream Library Headers
Stream Input/Output Classes and Objects
Stream Output
Output of char * Variables
Character Output Using Member Function put
Stream Input
get and getline Member Functions
istream Member Functions peek, putback and ignore
Type-Safe I/O
Unformatted I/O Using read, write and gcount
Introduction to StreamManipulators
Integral Stream Base: dec, oct, hex and setbase
Floating-Point Precision (precision, setprecision)
Field Width (width, setw)
User-Defined Output Stream Manipulators
Stream Format States and Stream Manipulators
Trailing Zeros and Decimal Points (showpoint)
Justification (left, right and internal)
Padding (fill, setfill)
Integral Stream Base (dec, oct, hex, showbase)
Floating-Point Numbers; Scientific and Fixed Notation (scientific, fixed)
Uppercase/Lowercase Control (uppercase)
Specifying Boolean Format (boolalpha)
Setting and Resetting the Format State via Member Function flags
Stream Error States
Tying an Output Stream to an Input Stream
Wrap-Up
Exception Handling: A Deeper Look
Introduction
Example: Handling an Attempt to Divide by Zero
When to Use Exception Handling
Rethrowing an Exception
Exception Specifications
Processing Unexpected Exceptions
Stack Unwinding
Constructors, Destructors and Exception Handling
Exceptions and Inheritance
Processing new Failures
Class unique_ptr and Dynamic Memory Allocation
Standard Library Exception Hierarchy
Wrap-Up
File Processing
Introduction
Files and Streams
Creating a Sequential File
Reading Data from a Sequential File
Updating Sequential Files
Random-Access Files
Creating a Random-Access File
Writing Data Randomly to a Random-Access File
Reading from a Random-Access File Sequentially
Case Study: A Transaction-Processing Program
Object Serialization
Wrap-Up
Class string and String Stream Processing
Introduction
string Assignment and Concatenation
Comparing strings
Substrings
Swapping strings
string Characteristics
Finding Substrings and Characters in a string
Replacing Characters in a string
Inserting Characters into a string
Conversion to C-Style Pointer-Based char * Strings
Iterators
String Stream Processing
Wrap-Up
Searching and Sorting
Introduction
Searching Algorithms
Efficiency of Linear Search
Binary Search
Sorting Algorithms
Efficiency of Selection Sort
Efficiency of Insertion Sort
Merge Sort (A Recursive Implementation)
Wrap-Up
Custom Templatized Data Structures
Introduction
Self-Referential Classes
Dynamic Memory Allocation and Data Structures
Linked Lists
Stacks
Queues
Trees
Wrap-Up
Bits, Characters, C Strings and structs
Introduction
Structure Definitions
typedef
Example: Card Shuffling and Dealing Simulation
Bitwise Operators
Bit Fields
Character-Handling Library
Pointer-Based String Manipulation Functions
Pointer-Based String-Conversion Functions
Search Functions of the Pointer-Based String-Handling Library
Memory Functions of the Pointer-Based String-Handling Library
Wrap-Up
Standard Template Library (STL)
Introduction to the Standard Template Library (STL)
Introduction to Containers
Introduction to Iterators
Introduction to Algorithms
Sequence Containers
vector Sequence Container
list Sequence Container
deque Sequence Container
Associative Containers
multiset Associative Container
set Associative Container
multimap Associative Container
map Associative Container
Container Adapters
stack Adapter
queue Adapter
priority_queue Adapter
Algorithms
fill, fill_n, generate and generate_n
equal, mismatch and lexicographical_compare
remove, remove_if, remove_copy and remove_copy_if
replace, replace_if, replace_copy and replace_copy_if
Mathematical Algorithms
Basic Searching and Sorting Algorithms
swap, iter_swap and swap_ranges
copy_backward, merge, unique and reverse
inplace_merge, unique_copy and reverse_copy
Set Operations
lower_bound, upper_bound and equal_range
Heapsort
min and max
STL Algorithms Not Covered in This Chapter
Class bitset
Function Objects
Wrap-Up
Boost Libraries, Technical Report 1 and C++0x
Introduction
Deitel Online C++ and Related Resource Centers
Boost Libraries
Boost Libraries Overview
Regular Expressions with the regex Library
Regular Expression Example
Validating User Input with Regular Expressions
Replacing and Splitting Strings
Smart Pointers
Reference Counted shared_ptr
weak_ptr: shared_ptr Observer
Technical Report 1
C++0x
Core Language Changes
Wrap-Up
Other Topics
Introduction
const_cast Operator
mutable Class Members
namespaces
Operator Keywords
Pointers to Class Members (.* and ->*)
Multiple Inheritance
Multiple Inheritance and virtual Base Classes
Wrap-Up
Chapters on the Web
Operator Precedence and Associativity
ASCII Character Set
Fundamental Types
Number Systems
Introduction
Abbreviating Binary Numbers as Octal and Hexadecimal Numbers
Converting Octal and Hexadecimal Numbers to Binary Numbers
Converting from Binary, Octal or Hexadecimal to Decimal
Converting from Decimal to Binary, Octal or Hexadecimal
Negative Binary Numbers: Two's Complement Notation
Preprocessor
Introduction
#include Preprocessor Directive
#define Preprocessor Directive: Symbolic Constants
#define Preprocessor Directive: Macros
Conditional Compilation
#error and #pragma Preprocessor Directives
Operators # and ##
Predefined Symbolic Constants
Assertions
Wrap-Up
Appendices on theWeb
Index
Chapters 25 26 and Appendices F I are PDF documents posted online at the book's
Companion Website, which is accessible from www.pearsonhighered.com/deitel.
ATM Case Study
Object-Oriented Design with the UML
Introduction
Introduction to Object-Oriented Analysis and Design
Examining the ATM Requirements Document
Identifying the Classes in the ATM Requirements Document
Identifying Class Attributes
Identifying Objects' States and Activities
Identifying Class Operations
Indicating Collaboration Among Objects
Wrap-Up
ATM Case Study
Implementing an Object-Oriented Design
Introduction
Starting to Program the Classes of the ATM System
Incorporating Inheritance into the ATM System
ATMCase Study Implementation
Class ATM
Class Screen
Class Keypad
Class CashDispenser
Class DepositSlot
Class Account
Class BankDatabase
Class Transaction
Class BalanceInquiry
Class Withdrawal
Class Deposit
Test Program ATMCaseStudy.cpp
Wrap-Up
C Legacy Code Topics
Introduction
Redirecting Input/Output on UNIX/Linux/Mac OS X and Windows Systems
Variable-Length Argument Lists
Using Command-Line Arguments
Notes on Compiling Multiple-Source-File Programs
Program Termination with exit and atexit
Type Qualifier volatile
Suffixes for Integer and Floating-Point Constants
Signal Handling
Dynamic Memory Allocation with calloc and realloc
Unconditional Branch: goto
Unions
Linkage Specifications
Wrap-Up
UML 2: Additional Diagram Types
Introduction
Additional Diagram Types
Using the Visual Studio Debugger
Introduction
Breakpoints and the Continue Command
Locals and Watch Windows
Controlling Execution Using the Step Into, Step Over, Step Out and Continue Commands
Autos Window
Wrap-Up
Using the GNU C++ Debugger
Introduction
Breakpoints and the run, stop, continue and print Commands
print and set Commands
Controlling Execution Using the step, finish and next Commands
watch Command
Wrap-Up