Sams Teach Yourself C++ in One Hour a Day, Sixth Edition

Book description

Sams Teach Yourself C++ in One Hour a Day

Jesse Liberty

Siddhartha Rao

Bradley Jones

The Sixth Edition of Sams Teach Yourself C++ in 21 Days

More than 250,000 sold!

In just one hour a day, you’ll have all the skills you need to begin programming in C++. With this complete tutorial, you’ll quickly master the basics and then move on to more advanced features and concepts:

  • Master the fundamentals of C++ and object-oriented programming

  • Learn some of the more advanced features of C++

  • Learn the Standard Template Library and the containers and algorithms used in most real-world C++ applications

  • Learn how to build effective programs in C++ with hands-on exercises

  • Get expert tips on implementing C++ in the corporate environment

  • Learn on your own time, at your own pace

  • No previous programming experience required

  • Learn C++ and object-oriented design, programming, and analysis

  • Write fast and powerful C++ programs, compile the source code, and create executable files

  • Understand the latest ANSI standard

  • Use the Standard Template Library’s algorithms and containers to write feature-rich yet stable C++ applications

  • Develop sophisticated programming techniques with functions, arrays, variables, and smart pointers

  • Learn to expand your program’s power with inheritance and polymorphism

  • Master the features of C++ by learning from programming experts

  • Works with all ANSI C++ compilers

  • Jesse Liberty is the author of numerous books on software development, including best-selling titles on C++ and .NET. He is the president of Liberty Associates, Inc., where he provides custom programming, consulting, and training.

    Siddhartha Rao, Microsoft MVP for Visual C++, has experience in programming driver and application software using C++. He is an expert in the Windows programming arena and works for a German software giant. He also moderates CodeGuru.com, a vibrant online programming community.

    Bradley Jones, Microsoft MVP for Visual C++, runs a number of software development sites including Developer.com, CodeGuru.com, DevX, VBForums, Gamelan, and other JupiterWeb-owned sites.

    Category:  Programming

    Covers:  C++

    User Level:  Beginning–Intermediate

    Register your book at informit.com/register for access to source code, example files, updates, and corrections as they become available.

    Table of contents

    1. Copyright
    2. Lead Author, Sixth Edition
    3. Contributing Authors
    4. Acknowledgments
    5. We Want to Hear from You!
    6. Reader Services
    7. Introduction
      1. Who Should Read This Book
      2. Organization of This Book
      3. Conventions Used in This Book
      4. Sample Code for This Book
    8. I. The Basics
      1. 1. Getting Started
        1. A Brief History of C++
          1. Interpreters and Compilers
          2. Changing Requirements, Changing Platforms
          3. Procedural, Structured, and Object-Oriented Programming
          4. Object-Oriented Programming
          5. C++ and Object-Oriented Programming
            1. Encapsulation
            2. Inheritance and Reuse
            3. Polymorphism
        2. How C++ Evolved
        3. Should I Learn C First?
        4. Microsoft’s Managed Extensions to C++
        5. The ANSI Standard
        6. Preparing to Program
        7. Your Development Environment
        8. The Process of Creating the Program
          1. Creating an Object File with the Compiler
          2. Creating an Executable File with the Linker
        9. The Development Cycle
        10. HELLO.cpp—Your First C++ Program
        11. Getting Started with Your Compiler
          1. Building the Hello World Project
        12. Compile Errors
        13. Summary
        14. Q&A
        15. Workshop
          1. Quiz
          2. Exercises
      2. 2. The Anatomy of a C++ Program
        1. A Simple Program
        2. A Brief Look at cout
        3. Using the Standard Namespace
        4. Commenting Your Programs
          1. Types of Comments
          2. Using Comments
          3. A Final Word of Caution About Comments
        5. Functions
          1. Using Functions
          2. Methods Versus Functions
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
      3. 3. Using Variables, Declaring Constants
        1. What Is a Variable?
          1. Storing Data in Memory
          2. Setting Aside Memory
          3. Size of Integers
          4. signed and unsigned
          5. Fundamental Variable Types
        2. Defining a Variable
          1. Case Sensitivity
          2. Naming Conventions
          3. Keywords
        3. Determining Memory Consumed by a Variable Type
        4. Creating More Than One Variable at a Time
        5. Assigning Values to Your Variables
        6. Creating Aliases with typedef
        7. When to Use short and When to Use long
          1. Wrapping Around an unsigned Integer
          2. Wrapping Around a signed Integer
        8. Working with Characters
          1. Characters and Numbers
          2. Special Printing Characters
        9. Constants
          1. Literal Constants
          2. Symbolic Constants
            1. Defining Constants with #define
            2. Defining Constants with const
        10. Enumerated Constants
        11. Summary
        12. Q&A
        13. Workshop
          1. Quiz
          2. Exercises
      4. 4. Managing Arrays and Strings
        1. What Is an Array?
          1. Accessing Array Elements
          2. Writing Past the End of an Array
          3. Fence Post Errors
          4. Initializing Arrays
          5. Declaring Arrays
        2. Multidimensional Arrays
          1. Declaring Multidimensional Arrays
          2. Initializing Multidimensional Arrays
        3. char Arrays and Strings
        4. Using the strcpy() and strncpy() Methods
        5. String Classes
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
      5. 5. Working with Expressions, Statements, and Operators
        1. Starting with Statements
          1. Using Whitespace
          2. Blocks and Compound Statements
        2. Expressions
        3. Working with Operators
          1. Assignment Operators
          2. Mathematical Operators
            1. Subtraction Troubles
            2. Integer Division and Modulus
        4. Combining the Assignment and Mathematical Operators
        5. Incrementing and Decrementing
          1. Prefixing Versus Postfixing
        6. Understanding Operator Precedence
        7. Nesting Parentheses
        8. The Nature of Truth
          1. Evaluating with the Relational Operators
        9. The if Statement
          1. Indentation Styles
          2. The else Statement
          3. Advanced if Statements
        10. Using Braces in Nested if Statements
        11. Using the Logical Operators
          1. The Logical AND Operator
          2. The Logical OR Operator
          3. The Logical NOT Operator
        12. Short Circuit Evaluation
        13. Relational Precedence
        14. More About Truth and Falsehood
        15. The Conditional (Ternary) Operator
        16. Summary
        17. Q&A
        18. Workshop
          1. Quiz
          2. Exercises
      6. 6. Organizing Code with Functions
        1. What Is a Function?
        2. Return Values, Parameters, and Arguments
        3. Declaring and Defining Functions
          1. Function Prototypes
          2. Defining the Function
        4. Execution of Functions
        5. Determining Variable Scope
          1. Local Variables
          2. Local Variables Within Blocks
        6. Parameters Are Local Variables
          1. Global Variables
          2. Global Variables: A Word of Caution
        7. Considerations for Creating Function Statements
        8. More About Function Arguments
        9. More About Return Values
        10. Default Parameters
        11. Overloading Functions
        12. Special Topics About Functions
          1. Inline Functions
          2. Recursion
        13. How Functions Work—A Peek Under the Hood
          1. Levels of Abstraction
            1. Partitioning RAM
            2. The Stack and Functions
        14. Summary
        15. Q&A
        16. Workshop
          1. Quiz
          2. Exercises
      7. 7. Controlling Program Flow
        1. Programming Loops
          1. The Roots of Looping: goto
          2. Why goto Is Shunned
        2. Using while Loops
          1. Exploring More Complicated while Statements
          2. Introducing continue and break
          3. Examining while(true) Loops
        3. Implementing do...while Loops
        4. Using do...while
        5. Looping with the for Statement
          1. Advanced for Loops
            1. Multiple Initialization and Increments
            2. Null Statements in for Loops
          2. Empty for Loops
          3. Nesting Loops
          4. Scoping in for Loops
        6. Summing Up Loops
        7. Controlling Flow with switch Statements
          1. Using a switch Statement with a Menu
        8. Summary
        9. Q&A
        10. Workshop
          1. Quiz
          2. Exercises
      8. 8. Pointers Explained
        1. What Is a Pointer?
          1. A Bit About Memory
          2. Getting a Variable’s Memory Address
          3. Storing a Variable’s Address in a Pointer
          4. Pointer Names
          5. Getting the Value from a Variable
          6. Dereferencing with the Indirection Operator
          7. Pointers, Addresses, and Variables
          8. Manipulating Data by Using Pointers
          9. Examining the Address
          10. Pointers and Array Names
          11. A Pointer to an Array Versus an Array of Pointers
        2. Why Would You Use Pointers?
        3. The Stack and the Free Store (Heap)
          1. Allocating Space with the new Keyword
          2. Putting Memory Back: The delete Keyword
        4. Another Look at Memory Leaks
        5. Creating Objects on the Free Store
        6. Deleting Objects from the Free Store
        7. Stray, Wild, or Dangling Pointers
        8. Using const Pointers
        9. Summary
        10. Q&A
        11. Workshop
          1. Quiz
          2. Exercises
      9. 9. Exploiting References
        1. What Is a Reference?
        2. Using the Address-Of Operator (&) on References
          1. Attempting to Reassign References (Not!)
        3. Null Pointers and Null References
        4. Passing Function Arguments by Reference
          1. Making swap() Work with Pointers
          2. Implementing swap() with References
        5. Returning Multiple Values
          1. Returning Values by Reference
        6. Passing by Reference for Efficiency
          1. Passing a const Pointer
          2. References as an Alternative
        7. Knowing When to Use References Versus Pointers
        8. Mixing References and Pointers
        9. Returning Out-of-Scope Object References
          1. The Problem with Returning a Reference to an Object on the Heap/Free Store
        10. Summary
        11. Q&A
        12. Workshop
          1. Quiz
          2. Exercises
    9. II. Fundamentals of Object-Oriented Programming and C++
      1. 10. Classes and Objects
        1. Is C++ Object-Oriented?
        2. Creating New Types
        3. Introducing Classes and Members
          1. Declaring a Class
          2. A Word on Naming Conventions
          3. Defining an Object
          4. Classes Versus Objects
        4. Accessing Class Members
          1. Assigning to Objects, Not to Classes
          2. If You Don’t Declare It, Your Class Won’t Have It
        5. Private Versus Public Access
          1. Making Member Data Private
        6. Implementing Class Methods
        7. Adding Constructors and Destructors
          1. Getting a Default Constructor and Destructor
          2. Using the Default Constructor
        8. Including const Member Functions
        9. Where to Put Class Declarations and Method Definitions
        10. Inline Implementation
        11. Classes with Other Classes as Member Data
        12. Exploring Structures
        13. Summary
        14. Q&A
        15. Workshop
          1. Quiz
          2. Exercises
      2. 11. Implementing Inheritance
        1. What Is Inheritance?
          1. Inheritance and Derivation
          2. The Animal Kingdom
          3. The Syntax of Derivation
        2. Private Versus Protected
        3. Inheritance with Constructors and Destructors
          1. Passing Arguments to Base Constructors
        4. Overriding Base Class Functions
          1. Hiding the Base Class Method
          2. Calling the Base Method
        5. Virtual Methods
          1. How Virtual Functions Work
          2. Trying to Access Methods from a Base Class
          3. Slicing
          4. Creating Virtual Destructors
          5. Virtual Copy Constructors
          6. The Cost of Virtual Methods
        6. Private Inheritance
          1. Using Private Inheritance
          2. Private Inheritance Versus Aggregation (Composition)
        7. Summary
        8. Q&A
        9. Workshop
          1. Quiz
          2. Exercises
      3. 12. Polymorphism
        1. Problems with Single Inheritance
          1. Percolating Upward
          2. Casting Down
          3. Adding to Two Lists
        2. Multiple Inheritance
          1. The Parts of a Multiply Inherited Object
          2. Constructors in Multiply Inherited Objects
          3. Ambiguity Resolution
          4. Inheriting from Shared Base Class
          5. Virtual Inheritance
          6. Problems with Multiple Inheritance
          7. Mixins and Capabilities Classes
        3. Abstract Data Types
          1. Pure Virtual Functions
          2. Implementing Pure Virtual Functions
          3. Complex Hierarchies of Abstraction
          4. Which Classes Are Abstract?
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      4. 13. Operator Types and Operator Overloading
        1. What Are Operators in C++?
        2. Unary Operators
          1. Types of Unary Operators
          2. Programming a Unary Increment/Decrement Operator
          3. Programming Dereference Operator * and Member Selection Operator ->
          4. Programming Conversion Operators
        3. Binary Operators
          1. Types of Binary Operators
          2. Programming Binary Addition (a+b) and Subtraction (a−b) Operators
          3. Programming Addition-Assignment and Subtraction-Assignment Operators
          4. Overloading Comparison Operators
          5. Overloading <, >, <=, and >= Operators
          6. Subscript Operators
        4. Function operator()
        5. Operators That Cannot Be Redefined
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
      5. 14. Casting Operators
        1. What Is Casting?
        2. The Need for Casting
        3. Why C-Style Casts Are Not Popular with Some C++ Programmers
        4. The C++ Casting Operators
          1. Using static_cast
          2. Using dynamic_cast and Runtime Type Identification
          3. Using reinterpret_cast
          4. Using const_cast
        5. Problems with the C++ Casting Operators
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
      6. 15. An Introduction to Macros and Templates
        1. The Preprocessor and the Compiler
        2. The #define Preprocessor Directive
        3. Macro Functions
          1. Why All the Parentheses?
          2. How Macros and Poor Type Safety Go Hand-in-Hand
          3. Macros Versus Functions and Templates
          4. Inline Functions
        4. An Introduction to Templates
          1. Template Declaration Syntax
          2. The Different Types of Template Declarations
          3. Template Classes
          4. Template Instantiation and Specialization
          5. Template and Type Safety
          6. Declaring Templates with Multiple Parameters
          7. Declaring Templates with Default Parameters
          8. A Template Sample
          9. Using Templates in Practical C++ Programming
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
    10. III. Learning the Standard Template Library (STL)
      1. 16. An Introduction to the Standard Template Library
        1. STL Containers
          1. Sequential Containers
          2. Associative Containers
          3. Choosing the Right Container
        2. STL Iterators
        3. STL Algorithms
        4. The Interaction Between Containers and Algorithms Using Iterators
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
      2. 17. The STL string Class
        1. The Need for String Manipulation Classes
        2. Working with the STL string Class
          1. Instantiating the STL string and Making Copies
          2. Accessing a string and Its Contents
          3. String Concatenation
          4. Finding a Character or Substring in a string
          5. Truncating an STL string
          6. String Reversal
          7. String Case Conversion
        3. Template-Based Implementation of an STL string
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      3. 18. STL Dynamic Array Classes
        1. The Characteristics of std::vector
        2. Typical Vector Operations
          1. Instantiating a vector
          2. Inserting Elements in a vector
          3. Accessing Elements in a vector
          4. Removing Elements from a vector
        3. Understanding size() and capacity()
        4. The STL deque Class
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      4. 19. STL list
        1. The Characteristics of a std::list
        2. Basic list Operations
          1. Instantiating a std::list Object
          2. Inserting Elements at the Front of the list
          3. Inserting Elements at the Back of the list
          4. Inserting at the Middle of the list
          5. Erasing Elements in a list
        3. Reversing and Sorting Elements in a list
          1. Reversing Elements
          2. Sorting Elements
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      5. 20. STL set and multiset
        1. An Introduction
        2. Basic STL set and multiset Operations
          1. Instantiating a std::set Object
          2. Inserting Elements in an STL set or multiset
          3. Finding Elements in an STL set or multiset
          4. Erasing Elements in an STL set or multiset
        3. Pros and Cons of Using STL set and multiset
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      6. 21. STL map and multimap
        1. A Brief Introduction
        2. Basic STL map and multimap Operations
          1. Instantiating a std::map Object
          2. Inserting Elements in an STL map or multimap
          3. Finding Elements in an STL map or multimap
          4. Erasing Elements from an STL map or multimap
        3. Supplying a Custom Sort Predicate
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
    11. IV. More STL
      1. 22. Understanding Function Objects
        1. The Concept of Function Objects and Predicates
        2. Typical Applications of Function Objects
          1. Unary Functions
          2. Unary Predicate
          3. Binary Functions
          4. Binary Predicate
        3. Summary
        4. Q&A
        5. Workshop
          1. Quiz
          2. Exercises
      2. 23. STL Algorithms
        1. What Are STL Algorithms?
        2. Classification of STL Algorithms
          1. Nonmutating Algorithms
          2. Mutating Algorithms
        3. Usage of STL Algorithms
          1. Counting and Finding Elements
          2. Searching for an Element or a Range in a Collection
          3. Initializing Elements in a Container to a Specific Value
          4. Processing Elements in a Range Using for_each
          5. Performing Transformations on a Range Using std::transform
          6. Copy and Remove Operations
          7. Replacing Values and Replacing Element Given a Condition
          8. Sorting and Searching in a Sorted Collection, and Erasing Duplicates
          9. Partitioning a Range
          10. Inserting Elements in a Sorted Collection
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      3. 24. Adaptive Containers: stack and queue
        1. The Behavioral Characteristics of Stacks and Queues
          1. Stacks
          2. Queues
        2. Using the STL stack Class
          1. Instantiating the Stack
          2. Stack Member Functions
        3. Using the STL queue Class
          1. Instantiating the Queue
          2. Member Functions of a queue
        4. Using the STL Priority Queue
          1. Instantiating the priority_queue Class
          2. Member Functions of priority_queue
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      4. 25. Working with Bit Flags Using STL
        1. The bitset Class
          1. Instantiating the std::bitset
        2. Using std::bitset and Its Members
          1. std:bitset Operators
          2. std::bitset Member Methods
        3. The vector<bool>
          1. Instantiating a vector<bool>
          2. Using the vector<bool>
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
    12. V. Advanced C++ Concepts
      1. 26. Understanding Smart Pointers
        1. What Are Smart Pointers?
          1. What Is the Problem with Using Conventional (Raw) Pointers?
          2. How Do Smart Pointers Help?
        2. How Are Smart Pointers Implemented?
        3. Types of Smart Pointers
          1. Deep Copy
          2. Copy on Write Mechanism
          3. Reference Counted Smart Pointers
          4. Reference-Linked Smart Pointers
          5. Destructive Copy
        4. Using the std::auto_ptr
        5. Popular Smart Pointer Libraries
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
      2. 27. Working with Streams
        1. Overview of Streams
          1. Encapsulation of Data Flow
          2. Understanding Buffering
        2. Streams and Buffers
        3. Standard I/O Objects
        4. Redirection of the Standard Streams
        5. Input Using cin
          1. Inputting Strings
          2. String Problems
          3. The cin Return Value
        6. Other Member Functions of cin
          1. Single Character Input
            1. Using get() with No Parameters
            2. Using get() with a Character Reference Parameter
          2. Getting Strings from Standard Input
          3. Using cin.ignore()
          4. Peeking At and Returning Characters: peek() and putback()
        7. Outputting with cout
          1. Flushing the Output
          2. Functions for Doing Output
            1. Writing Characters with put()
            2. Writing More with write()
          3. Manipulators, Flags, and Formatting Instructions
            1. Using cout.width()
            2. Setting the Fill Characters
            3. Managing the State of Output: Set Flags
        8. Streams Versus the printf() Function
        9. File Input and Output
          1. Using the ofstream
          2. Condition States
          3. Opening Files for Input and Output
          4. Changing the Default Behavior of ofstream on Open
        10. Binary Versus Text Files
        11. Command-Line Processing
        12. Summary
        13. Q&A
        14. Workshop
          1. Quiz
          2. Exercises
      3. 28. Exception Handling
        1. Bugs, Errors, Mistakes, and Code Rot
          1. Exceptional Circumstances
        2. The Idea Behind Exceptions
          1. The Parts of Exception Handling
          2. Causing Your Own Exceptions
          3. Creating an Exception Class
        3. Placing try Blocks and catch Blocks
        4. How Catching Exceptions Work
          1. Using More Than One catch Specification
          2. Exception Hierarchies
        5. Data in Exceptions and Naming Exception Objects
        6. Exceptions and Templates
        7. Exceptions Without Errors
        8. Bugs and Debugging
          1. Breakpoints
          2. Watch Points
          3. Examining Memory
          4. Assembler
        9. Summary
        10. Q&A
        11. Workshop
          1. Quiz
          2. Exercises
      4. 29. Tapping Further into the Preprocessor
        1. The Preprocessor and the Compiler
        2. The #define Preprocessor Directive
          1. Using #define for Constants
          2. Using #define for Tests
          3. The #else Precompiler Command
        3. Inclusion and Inclusion Guards
        4. String Manipulation
          1. Stringizing
          2. Concatenation
        5. Predefined Macros
        6. The assert() Macro
          1. Debugging with assert()
          2. Using assert() Versus Exceptions
          3. Side Effects
          4. Class Invariants
          5. Printing Interim Values
        7. Bit Twiddling
          1. Operator AND
          2. Operator OR
          3. Operator Exclusive OR
          4. The Complement Operator
          5. Setting Bits
          6. Clearing Bits
          7. Flipping Bits
          8. Bit Fields
        8. Programming Style
          1. Indenting
          2. Braces
          3. Long Lines and Function Length
          4. Structuring switch Statements
          5. Program Text
          6. Naming Identifiers
          7. Spelling and Capitalization of Names
          8. Comments
          9. Setting Up Access
          10. Class Definitions
          11. include Files
          12. Using assert()
          13. Making Items Constant with const
        9. Next Steps in Your C++ Development
          1. Where to Get Help and Advice
          2. Related C++ Topics: Managed C++, C#, and Microsoft’s .NET
        10. Summary
        11. Q&A
        12. Workshop
          1. Quiz
          2. Exercises
    13. Appendixes
      1. A. Working with Numbers: Binary and Hexadecimal
        1. Using Other Bases
        2. Converting to Different Bases
          1. Binary
          2. Why Base 2?
          3. Bits, Bytes, and Nybbles
          4. What’s a KB?
          5. Binary Numbers
        3. Hexadecimal
      2. B. C++ Keywords
      3. C. Operator Precedence
      4. D. Answers
        1. Lesson 1, “Getting Started”
          1. Quiz
          2. Exercises
        2. Lesson 2, “The Anatomy of a C++ Program”
          1. Quiz
          2. Exercises
        3. Lesson 3, “Using Variables, Declaring Constants”
          1. Quiz
          2. Exercises
        4. Lesson 4, “Managing Arrays and Strings”
          1. Quiz
          2. Exercises
        5. Lesson 5, “Working with Expressions, Statements, and Operators”
          1. Quiz
          2. Exercises
        6. Lesson 6, “Organizing Code with Functions”
          1. Quiz
          2. Exercises
        7. Lesson 7, “Controlling Program Flow”
          1. Quiz
          2. Exercises
        8. Lesson 8, “Pointers Explained”
          1. Quiz
          2. Exercises
        9. Lesson 9, “Exploiting References”
          1. Quiz
          2. Exercises
        10. Lesson 10, “Classes and Objects”
          1. Quiz
          2. Exercises
        11. Lesson 11, “Implementing Inheritance”
          1. Quiz
          2. Exercises
        12. Lesson 12, “Polymorphism”
          1. Quiz
          2. Exercises
        13. Lesson 13, “Operator Types and Operator Overloading”
          1. Quiz
          2. Exercises
        14. Lesson 14, “Casting Operators”
          1. Quiz
        15. Lesson 15, “An Introduction to Macros and Templates”
          1. Quiz
          2. Exercises
        16. Lesson 16, “An Introduction to the Standard Template Library”
          1. Quiz
        17. Lesson 17, “The STL string Class”
          1. Quiz
          2. Exercises
        18. Lesson 18, “STL Dynamic Array Classes”
          1. Quiz
          2. Exercises
        19. Lesson 19, “STL list”
          1. Quiz
          2. Exercises
        20. Lesson 20, “STL set and multiset”
          1. Quiz
          2. Exercises
        21. Lesson 21, “STL map and multimap”
          1. Quiz
          2. Exercises
        22. Lesson 22, “Understanding Function Objects”
          1. Quiz
          2. Exercises
        23. Lesson 23, “STL Algorithms”
          1. Quiz
          2. Exercises
        24. Lesson 24, “Adaptive Containers: stack and queue”
          1. Quiz
          2. Exercises
        25. Lesson 25, “Working with Bit Flags Using STL”
          1. Quiz
          2. Exercises
        26. Lesson 26, “Understanding Smart Pointers”
          1. Quiz
          2. Exercises
        27. Lesson 27, “Working with Streams”
          1. Quiz
          2. Exercises
        28. Lesson 28, “Exception Handling”
          1. Quiz
          2. Exercises
        29. Lesson 29, “Tapping Further into the Preprocessor”
          1. Quiz
          2. Exercises
      5. Inside Back Cover

    Product information

    • Title: Sams Teach Yourself C++ in One Hour a Day, Sixth Edition
    • Author(s): Jesse Liberty, Siddhartha Rao, Bradley Jones
    • Release date: July 2008
    • Publisher(s): Sams
    • ISBN: 9780768678598