Formatted contents note |
1 Introduction to Computers, the Internet and<br/>the World Wide Web<br/>1.1 introcluciion<br/>1.2 Computers: Hardware and SoFt\vare<br/>1.3 Computer Organization<br/>1.4 Personal, Distributed and Client/Server Computing<br/>1.5 The Internet and the World Wide Web<br/>1.6 Web 2.0<br/>1.7 Machine Languages. Assembly Languages<br/>and High-Lcvcl Languages<br/>1.8 Histor)' of C and C++<br/>1.9 C++Standard Library<br/>1.10 History of Java<br/>1.11 Fortran, COBOL, Pascal and Ada<br/>1.12 BASIC, Visual Basic, Visual C++, C# and .NET<br/>1.13 Key Software Trend: Object Technology<br/>1.14 Typical C++ Development Environment<br/>1.15 Notes About C++ and C+ + How to Pro^am, 7le<br/>1.16 Test-Driving a C++ Application<br/>1.17 Software Technologies<br/>1.18 Future of C++: Open Source Boost Libraries, TRl and C++Ox<br/>1.19 Software Engineering Case Study: Introduction to Object Technology<br/>and the UML<br/>1.20 Wrap-Up<br/>1.21 Web Resources<br/>2 Introduction to C++ Programming<br/>2.1 Introduction<br/>2.2 First Program in C++: Printing a Line of Text<br/>2.3 Modifying Our First C++ Program<br/>2.4 Another C++ Program: Adding Integers<br/>2.5 Memory Concepts<br/>2.6 Arithmetic<br/>2.7 Decision Making: Equality and Relational Operators<br/>2.8 Wrap-Up<br/>3 Introduction to Classes and Objects<br/>3.1 Introduction<br/>3.2 Classes, Objects, Member Functions and Data Members<br/>3.3 Defining a Class with a Member Function<br/>3.4 Defining a Member Function with a Parameter<br/>3.5 Data Members, set Functions and get Functions<br/>3.6 Initializing Objects with Constructors<br/>3.7 Placing a Class in a Separate File for Reusability<br/>3.8 Separating Interface from Implementation<br/>3.9 Validating Data with set Functions<br/>3.10 Wrap-Up<br/>4 Control Statements: Part I<br/>4.1 Introduction<br/>4.2 Algorithms<br/>4.3 Pseudocode<br/>4.4 Control Structures<br/>4.5 if Selection Statement<br/>4.6 i f...el se Double-Selection Statement<br/>4.7 while Repetition Statement<br/>4.8 Formulating Algorithms: Counter-Controlled Repetition<br/>4.9 Formulating Algorithms: Sentinel-Controlled Repetition<br/>4.10 Formulating Algorithms: Nested Control Statements<br/>4.11 Assignment Operators<br/>4.12 Increment and Decrement Operators<br/>4.13 Wrap-Up<br/>5 Control Statements: Part 2<br/>5.1 Introduction<br/>5.2 Essentials of Counter-Controlled Repetition<br/>5.3 for Repetition Statement<br/>5.4 Examples Using the for Statement<br/>5.5 do...while Repetition Statement<br/>5.6 switch Multiple-Selection Statement<br/>5.7 break and continue Statements<br/>5.8 Logical Operators<br/>5.9 Confusing the Equality (==) and Assignment (=) Operators<br/>• structured Programming Summary<br/>5.11 Wrap-Up<br/>6 Functions and an Introduction to Recursion<br/>6.1 Introduction<br/>6.2 Program Components in C++<br/>6.3 Math Librar)' Functions<br/>6.4 Function Definitions with Multiple Parameters<br/>6.5 Function Prototypes and Argument Coercion<br/>6.6 C++ Standard Library Header Files<br/>6.7 Case Study: Random Number Generation<br/>6.8 Ca.se Study: Game of Chance; Introducing enum<br/>6.9 Storage Classes<br/>6.10 Scope Rules<br/>6.11 Function Call Stack and Activation Records<br/>6.12 Functions with Empty Parameter Lists<br/>6.13 Inline Functions<br/>6.14 References and Reference Parameters<br/>6.15 Default Arguments<br/>6.16 Unary Scope Resolution Operator<br/>6.17 Function Overloading<br/>6.18 Function Templates<br/>6.19 Recursion<br/>6.20 Example Using Recursion: Fibonacci Series<br/>6.21 Recursion vs. Iteration<br/>6.22 Wrap-Up<br/>7 Arrays and Vectors<br/>7.1 Introduction<br/>7.2 Arrays<br/>7.3 Declaring Arrays<br/>7.4 Examples Using Arrays<br/>7.4.1 Declaring an Array and Using a Loop to Initialize the<br/>Array's Elements<br/>7.4.2 Initializing an Array in a Declaration with an Initializer List<br/>7.4.3 Specifying an Array's Size with a Constant Variable and<br/>Setting Array Elements with Calculations<br/>7.4.4 Summing the Elements of an Array<br/>7.4.5 Using Bar Charts to Display Array Data Graphically<br/>7.4.6 Using the Elements of an Array as Counters<br/>7.4.7 Using Arrays to Summarize Survey Results<br/>7.4.8 Static Local Arrays and Automatic Local Arrays<br/>7.5 Passing Arrays to Functions<br/>7.6 Case Study: Class GradeBook Using an Array to Store Grades<br/>7.7 Searching Arrays with Linear Search<br/>7.8 Sorting Arrays with Insertion Sort<br/>7.9 Multidimensional Arrays<br/>7.10 Case Study: Class GradeBook Using a Two-Dimensional Array<br/>7.11 Introduction to C++ Standard Library Class Template vector<br/>7.12 Wrap-Up<br/>8 Pointers<br/>8.1 Introduction<br/>8.2 Pointer Variable Declarations and Initialization<br/>8.3 Pointer Operators<br/>8.4 Pass-by-Reference with Pointers<br/>8.5 Using const with Pointers<br/>8.6 Selection Sort Using Pass-by-Reference<br/>8.7 sizeof Operator<br/>8.8 Pointer Expressions and Pointer Arithmetic<br/>8.9 Relationship Between Pointers and Arrays<br/>8.10 Pointer-Based String Processing<br/>8.11 Arrays of Pointers<br/>8.12 Function Pointers<br/>8.13 Wrap-Up<br/>9 Classes: A Deeper Look, Fart I<br/>9.1 Introduction<br/>9.2 Ti me Class Case Study<br/>9.3 Class Scope and Accessing Class Members<br/>9.4 Separating Interface from Implementation<br/>9.5 Access Functions and Utility Functions<br/>9.6 Time Class Case Study: Constructors with Default Arguments<br/>9.7 Destructors<br/>9.8 When Constructors and Destructors Are Called<br/>9.9 Time Class Case Study: A Subtle Trap—Returning a Reference to a<br/>private Data Member<br/>9.10 Default Memberwise Assignment<br/>9.11 Wrap-Up<br/>10 Classes: A Deeper Look, Part 2<br/>10.1 Introduction<br/>10.2 const (Constant) Objects and const Member Functions<br/>10.3 Composition: Objects as Members of Classes<br/>10.4 friend Functions and friend Classes<br/>10.5 Using the thi s Pointer<br/>10.6 static Class Members<br/>10.7 Data Abstraction and Information Hiding<br/>10.8 Wrap-Up<br/>I I Operator Overloading<br/>11.1 Introduction<br/>11.2 Fundamentals of Operator Overloading<br/>11.3 Restrictions on Operator Overloading<br/>11.4 Operator Functions as Class Members vs. Global Functions<br/>11.5 Overloading Stream Insertion and Stream Extraction Operators<br/>11.6 Overloading Unary Operators<br/>11.7 Overloading Binary Operators<br/>11.8 Dynamic Memory Management<br/>11.9 Case Study: Array Class<br/>11.10 Converting between Types<br/>11.11 Building a String Class<br/>11.12 Overloading++and --<br/>11.13 Case Study: A Date Class<br/>11.14 Standard Library Class string<br/>11.15 explicit Constructors<br/>11.16 Proxy Classes<br/>11.17 Wrap-Up<br/>12 Object-Oriented Programming: Inheritance<br/>12.1 Introduction<br/>12.2 Base Classes and Derived Classes<br/>12.3 protected Members<br/>12.4 Relationship between Base Classes and Derived Classes<br/>12.4.1 Creating and Using a CommissionEmployee Class<br/>12.4.2 Creating a BasePl usCommi ssi onEmpl oyee Class Without<br/>Using Inheritance<br/>12.4.3 Creating a Commi ssi onEmployee—BasePlusCommi ssi onEmployee<br/>Inheritance Hierarchy<br/>12.4.4 Commi ssi onEmployee-BasePlusCommi ssionEmployee<br/>Inheritance Hierarchy Using protected Data<br/>12.4.5 Commi ssi onEmployee-BasePIusCommi ssi onEmployee<br/>Inheritance Hierarchy Using private Data<br/>12.5 Constructors and Destructors in Derived Classes<br/>12.6 public, protected and private Inheritance<br/>12.7 Software Engineering with Inheritance<br/>12.8 Wrap-Up<br/>I 3 Object-Oriented Programming: Polymorphism<br/>13.1 Introduction<br/>13.2 Polymorphism Examples<br/>13.3 Relationships Among Objects in an Inheritance Hierarchy<br/>13.3.1 Invoking Base-Class Functions from Derived-Class Objects<br/>13.3.2 Aiming Derived-Class Pointers at Base-Class Objects<br/>13.3.3 Derived-Class Member-Function Calls via Base-Class Pointers<br/>13.3.4 Virtual Functions<br/>13.3.5 Summary of the Allowed Assignments Between Base-Class<br/>and Derived-Class Objects and Pointers<br/>13.4 Type Fields and switch Statements<br/>13.5 Abstract Classes and Pure VI rtual Functions<br/>13.6 Case Study: Payroll System Using Polymorphism<br/>13.6.1 Creating Abstract Base Class Empl oyee<br/>13.6.2 Creating Concrete Derived Class SalariedEmployee<br/>13.6.3 Creating Concrete Derived Class HourlyEmployee<br/>13.6.4 Creating Concrete Derived Class CommissionEmployee<br/>13.6.5 Creating Indirect Concrete Derived Class<br/>BasePlusCommi ssi onEmployee<br/>13.6.6 Demonstrating Polymorphic Processing<br/>13.7 (Optional) Polymorphism, Virtual Functions and Dynamic Binding<br/>"Under the Hood"<br/>13.8 Case Study: Payroll System Using Polymorphism and Runtime Type<br/>Information with Downcasting, dynamic_cast, typeid and type_info<br/>13.9 Virtual Destructors<br/>13.10 Wrap-Up<br/>14 Templates<br/>14.1 Introduction<br/>14.2 Function Templates<br/>14.3 Overloading Function Templates<br/>14.4 Class Templates<br/>14.5 Nontype Parameters and Default Types for Class Templates<br/>14.6 Notes on Templates and Inheritance<br/>14.7 Notes on Templates and Friends<br/>14.8 Notes on Templates and stati c Members<br/>14.9 Wrap-Up<br/>15 Stream Input/Output<br/>15.1 Introduction<br/>15.2 Streams<br/>15.2.1 Classic Streams vs. Standard Streams<br/>15.2.2 iostream Library Header Files<br/>15.2.3 Stream Input/Output Classes and Objects<br/>15.3 Stream Output<br/>15.3.1 Output of char * Variables<br/>15.3.2 Character Output Using Member Function put<br/>15.4 Stream Input<br/>15.4.1 get and get! i ne Member Functions<br/>15.4.2 1 stream Member Functions peek, putback and ignore<br/>15.4.3 Type-Safe I/O ><br/>15.5 Unformatted I/O Using read, wri te and gcount<br/>15.6 Introduction to Stream Manipulators<br/>15.6.1 Integral Scream Base: dec, oct, hex and setbase<br/>15.6.2 Floating-Point Precision (precision, setprecision)<br/>15.6.3 Field Width (width, setw)<br/>15.6.4 User-Defined Output Stream Manipulators<br/>15.7 Stream Format States and Stream Manipulators<br/>15.7.1 Trailing Zeros and Decimal Points (showpoint)<br/>15.7.2 Justification (left, right and internal)<br/>15.7.3 Padding (fill, setfill)<br/>15.7.4 Integral Stream Base (dec, oct, hex, showbase)<br/>15.7.5 Floating-Point Numbers; Scientific and Fixed Notation<br/>(scientific, fixed)<br/>15.7.6 Uppercase/Lowercase Control (uppercase)<br/>15.7.7 Specifying Boolean Format (bool al pha)<br/>15.7.8 Setting and Resetting the Format State via Member<br/>Function flags<br/>15.8 Stream Error States<br/>15.9 Tying an Output Stream to an Input Stream<br/>15.10 Wrap-Up<br/>I 6 Exception Handling<br/>16.1 Introduction<br/>16.2 Exception-Handling Overview<br/>16.3 Example: Handling an Attempt to Divide by Zero<br/>16.4 When to Use Exception Handling<br/>16.5 Rethrowing an Exception<br/>16.6 Exception Specifications<br/>16.7 Processing Unexpected Exceptions<br/>16.8 Stack Unwinding<br/>16.9 Constructors, Destructors and Exception Handling<br/>16.10 Exceptions and Inheritance<br/>16.11 Processing new Failures<br/>16.12 Class auto_ptr and Dynamic Memory Allocation<br/>16.13 Standard Library Exception Hierarchy<br/>16.14 Other Error-Handling Techniques<br/>16.15 Wrap-Up<br/>I 7 File Processing<br/>17.1 Introduction<br/>17.2 Data Hierarchy<br/>17.3 Files and Streams<br/>17.4 Creating a Sequential File<br/>17.5 Reading Data from a Sequential File<br/>17.6 Updating Sequential Files<br/>17.7 Random-Access Files<br/>17.8 Creating a Random-Access File<br/>17.9 Writing Data Randomly to a Random-Access File<br/>17.10 Reading from a Random-Access File Sequentially<br/>17.11 Case Study: A Transaction-Processing Program<br/>17.12 Overview of Object Serialization<br/>17.13 Wrap-Up<br/>I 8 Class string and String Stream Processing<br/>18.1 Introduction<br/>18.2 string Assignment and Concatenation<br/>18.3 Comparing strings<br/>18.4 Substrings<br/>18.5 Swapping strings<br/>18.6 string Characteristics<br/>18.7 Finding Substrings and Characters in a string<br/>18.8 Replacing Characters in a string<br/>18.9 Inserting Characters into a string<br/>18.10 Conversion to C-Style Pointer-Based char * Strings<br/>18.11 Iterators<br/>18.12 String Stream Processing<br/>18.13 Wrap-Up<br/>1 9 Searching and Sorting<br/>19.1 Introduction<br/>19.2 Searching Algorithms<br/>19.2.1 Efficiency of Linear Search<br/>19.2.2 Binary Search<br/>19.3 Sorting Algorithms<br/>19.3.1 Efficiency of Selection Sort<br/>19.3.2 Efficiency of Insertion Sort<br/>19.3.3 Merge Sort (A Recursive Implementation)<br/>19.4 Wrap-Up<br/>20 Data Structures<br/>20.1 Introduction<br/>20.2 Self-Referential Classes<br/>20.3 Dynamic Memory Allocation and Data Structures<br/>20.4 Linked Lists<br/>20.5 Stacks<br/>20.6 Queues<br/>20.7 Trees<br/>20.8 Wrap-Up<br/>2 I Bits, Characters, C Strings and structs<br/>21.1 Introduction<br/>21.2 Structure Definitions<br/>21.3 Initializing Structures<br/>21.4 Using Structures with Functions<br/>21.5 typedef<br/>21.6 Example: Card Shuffling and Dealing Simulation<br/>21.7 Bitwise Operators<br/>21.8 Bit Fields<br/>21.9 Character-Handling Library<br/>21.10 Pointer-Based String Manipulation Functions<br/>21.11 Pointer-Based String-Conversion Functions<br/>21.12 Search Functions of the Pointer-Based String-Handling Library<br/>21.13 Memory Functions of the Pointer-Based String-Handling Library<br/>21.14 Wrap-Up<br/>22 Standard Template Library (STL)<br/>22.1 Introduction to the Standard Template Library (STL)<br/>22.1.1 Introduction to Containers<br/>22.1.2 Introduction to Iterators<br/>22.1.3 Introduction to Algorithms<br/>22.2 Sequence Containers<br/>22.2.1 vector Sequence Container<br/>22.2.2 1 i St Sequence Container<br/>22.2.3 deque Sequence Container<br/>22.3 Associative Containers<br/>22.3.1 mul ti set Associative Container<br/>22.3.2 set Associative Container<br/>22.3.3 mul ti map Associative Container<br/>22.3.4 map Associative Container<br/>22.4 Container Adapters<br/>22.4.1 stack Adapter<br/>22.4.2 queue Adapter<br/>22.4.3 priority_queue Adapter<br/>22.5 Algorithms<br/>22.5.1 fill, fill_n, generate and generate_n ,<br/>22.5.2 equal, mismatch and lexicographical_compare<br/>22.5.3 remove, remove_if, remove_copy and remove_copy_if<br/>22.5.4 replace, replace_if, replace_copy and replace_copy_if<br/>22.5.5 Mathematical Algorithms<br/>22.5.6 Basic Searching and Sorting Algorithms<br/>22.5.7 swap, iter_swap and swap_ranges<br/>22.5.8 copy_backward, merge, unique and reverse<br/>22.5.9 inplace_merge, unique_copy and reverse_copy<br/>22.5.10 Set Operations<br/>22.5.11 lower_bound, upper_bound and equal_range<br/>22.5.12 Heapsort<br/>22.3.13 minandmax<br/>22.5.14 STL Algorithms Not Covered in This Chapter<br/>22.6 Gassbltset<br/>22.7 Function Objects<br/>22.8 Wrap-Up<br/>22.9 STTL Web Resources<br/>Chapteis on the Web<br/>Chapters 23-27 are PDF documents posted online at the book's Companion Website<br/>(located at wmw . pearsonhighered. con/dei tel).<br/>23 Boost Libraries, Technical Report i and C-hOx<br/>23.1 Introduction<br/>23.2 Deitel Online C-I-+ and Related Resource Centers<br/>23.3 Boost Libraries<br/>23.4 Boost Libraries Overview<br/>23.5 Regular Expressions with the Boost. Regex Library<br/>23.5.1 Rj^ular Expression Example<br/>23.5.2 Validating User Input with R^lar Expressions<br/>23.5.3 Replacing and Splitting Strings<br/>23.6 Smart Pointers with Boost. Smart_ptr<br/>23.6.1 Reference Counted shared^ptr<br/>23.6.2 weakjF)tr: shared_ptr Observer<br/>23.7 Technical Report 1<br/>23.8 C-f+Ox<br/>23.9 Core Language Changes<br/>23.10 Wrap-Up<br/>24 Odier Topics<br/>24.1 Introduction<br/>24.2 const^cast Operator ^<br/>24.3 mutable Class Members<br/>24.4 namespaces<br/>24.5 Operator Keywords<br/>24.6 Pointers to Class Members (.* and ->*)<br/>24.7 Multiple Inheritance<br/>24.8 Multiple Inheritance and vi rtual Base<br/>24.9 Wrap-Up<br/>25 ATM Case Study, Part i: Object-Oriented<br/>Design with the UML<br/>25.1 Introduaion<br/>25.2 Examming the ATM Requirements Document<br/>25.3 Identifying the Classes in the ATM Requirements Document<br/>25.4 Identifying Class Attributes<br/>25.5 Identifying Objects' States and Activities<br/>25.6 Identifying Class Operations<br/>25.7 Indicating Collaboration Among Objects<br/>25.8 Wrap-Up<br/>26 ATM Case Study, Part 2: Implementing<br/>an Object-Oriented Design<br/>26.1 Introduction<br/>26.2 Starting to Program the Classes of the ATM System<br/>26.3 Incorporating Inheritance into the ATM System<br/>26.4 ATM Case Study Implementation<br/>26.4.1 Class ATM<br/>26.4.2 Class Screen<br/>26.4.3 Class Keypad<br/>26.4.4 Class CashDi Spenser<br/>26.4.5 Class Deposits!ot<br/>26.4.6 Class Account<br/>26.4.7 Class BankOatabase<br/>26.4.8 Class Transaction<br/>26.4.9 Class Balancelnqui ry<br/>26.4.10 Class Withdrawal<br/>26.4.11 Class Deposi t<br/>26.4.12 Test Program ATMCaseStudy. cpp<br/>26.5 Wrap-Up<br/>27 Game Programming with Ogre<br/>27.1 Introduction<br/>27.2 Installing Ogre, OgreAL and OpenAL<br/>27.3 Basics of Game Programming<br/>27.4 The Game of Pong: Code Walkthrough<br/>27.4.1 Ogre Initialization ,<br/>27.4.2 Creating a Scene<br/>27.4.3 Adding to the Scene<br/>27.4.4 Animation and Timers<br/>27.4.5 User Input<br/>27.4.6 Collision Detection<br/>27.4.7 Sound<br/>27.4.8 Resources<br/>27.4.9 Pong Driver<br/>27.5 Wrap-Up<br/>27.6 Ogre Web Resources |