C++ All-in-One For Dummies, 4th Edition

Book description

Get ready for C++20 with all you need to know for complete mastery! 

Your comprehensive and updated guide to one of the world’s most popular programming languages is here! Whether you’re a novice or expert, you’ll find what you need to get going with the latest features of C++20. The workhorse of programming languages, C++ gives you the utmost control of data usage and interface and resource allocation. If your job involves data, proficiency in C++ means you’re indispensable!

This edition gives you 8 books in 1 for total C++ mastery. Inside, internationally renowned expert John Paul Mueller takes you from the fundamentals of working with objects and classes to writing applications that use paradigms not normally associated with C++, such as those used for functional programming strategies. The book also includes online resources such as source code. You discover how to use a C++ GNU compiler to build applications and even how to use your mobile device for coding.

  • Conquer advanced programming and troubleshooting 
  • Streamline your code with lambda expressions
  • Use C++ where you need it: for gaming, enterprise applications, and Web services
  • Uncover object secrets including the use of design patterns 
  • Discover how to use functional programming techniques to make code concise and easy to read

If you want to be your organization’s C++ guru, C++ All-In-One for Dummies is where it’s at!

Table of contents

  1. Cover
  2. Title Page
  3. Copyright
  4. Introduction
    1. About This Book
    2. Foolish Assumptions
    3. Icons Used in This Book
    4. Beyond the Book
    5. Where to Go from Here
  5. Book 1: Getting Started with C++
    1. Chapter 1: Configuring Your Desktop System
      1. Obtaining a Copy of C++ 20
      2. Obtaining Code::Blocks
      3. Installing Code::Blocks
      4. Touring the Essential Code::Blocks Features
      5. Using Other IDEs
    2. Chapter 2: Configuring Your Mobile System
      1. Obtaining CppDroid
      2. Considering Other Alternatives
      3. Touring the Essential CppDroid Features
      4. Obtaining CppDroid Help
    3. Chapter 3: Creating Your First C++ Application
      1. Code::Blocks Creating a Project
      2. Typing the Code
      3. Starting with Main
      4. Showing Information
      5. Let Your Application Run Away
    4. Chapter 4: Storing Data in C++
      1. Putting Your Data Places: Variables
      2. Manipulating Integer Variables
      3. Characters
      4. Strings
      5. Making Decisions Using Conditional Operators
      6. Telling the Truth with Boolean Variables
      7. Reading from the Console
    5. Chapter 5: Directing the Application Flow
      1. Doing This or Doing That
      2. Evaluating Conditions in C++
      3. Including Evaluations in C++ Conditional Statements
      4. Repeating Actions with Statements That Loop
      5. Looping for
      6. Looping while
      7. Doing while
      8. Breaking and continuing
      9. Nesting loops
    6. Chapter 6: Dividing Your Work with Functions
      1. Dividing Your Work
      2. Calling a Function
      3. Writing Your Own Functions
      4. Improving On the Basic Function
      5. Calling All String Functions
      6. Understanding main()
    7. Chapter 7: Splitting Up Source Code Files
      1. Creating Multiple Source Files
      2. Sharing with Header Files
      3. Sharing Variables among Source Files
      4. Using the Mysterious Header Wrappers
    8. Chapter 8: Referring to Your Data Through Pointers
      1. Understanding the Changes in Pointers for C++ 20
      2. Heaping and Stacking the Variables
      3. Creating New Raw Pointers
      4. Freeing Raw Pointers
      5. Working with Smart Pointers
      6. Passing Pointer Variables to Functions
      7. Returning Pointer Variables from Functions
  6. Book 2: Understanding Objects and Classes
    1. Chapter 1: Working with Classes
      1. Understanding Objects and Classes
      2. Working with a Class
      3. Starting and Ending with Constructors and Destructors
      4. Building Hierarchies of Classes
      5. Creating and Using Object Aliases
    2. Chapter 2: Using Advanced C++ Features
      1. Filling Your Code with Comments
      2. Converting Types
      3. Reading from the Console
      4. Understanding Preprocessor Directives
      5. Using Constants
      6. Using Switch Statements
      7. Supercharging enums with Classes
      8. Working with Random Numbers
      9. Storing Data in Arrays
    3. Chapter 3: Planning and Building Objects
      1. Recognizing Objects
      2. Encapsulating Objects
      3. Building Hierarchies
    4. Chapter 4: Building with Design Patterns
      1. Delving Into Pattern History
      2. Introducing a Simple Pattern: the Singleton
      3. Watching an Instance with an Observer
      4. Mediating with a Pattern
  7. Book 3: Understanding Functional Programming
    1. Chapter 1: Considering Functional Programming
      1. Understanding How Functional Programming Differs
      2. Defining an Impure Language
      3. Seeing Data as Immutable
      4. Considering the Effects of State
      5. Eliminating Side Effects
      6. Understanding the Role of auto
      7. Passing Functions to Functions
      8. Using Lambda Expressions for Implementation
    2. Chapter 2: Working with Lambda Expressions
      1. Creating More Readable and Concise C++ Code
      2. Defining the Essential Lambda Expression
      3. Developing with Lambda Expressions
    3. Chapter 3: Advanced Lambda Expressions
      1. Considering the C++ 20 Lambda Extensions
      2. Working in Unevaluated Contexts
      3. Using Assignable Stateless Lambda Expressions
      4. Dealing with Pack Expansions
  8. Book 4: Fixing Problems
    1. Chapter 1: Dealing with Bugs
      1. It’s Not a Bug. It’s a Feature!
      2. Make Your Application Features Look Like Features
      3. Anticipating (Almost) Everything
      4. Avoiding Mistakes, Plain and Simple
    2. Chapter 2: Debugging an Application
      1. Programming with Debuggers
      2. Debugging with Different Tools
      3. Debugging a Code::Blocks Application with Command-Line Arguments
    3. Chapter 3: Stopping and Inspecting Your Code
      1. Setting and Disabling Breakpoints
      2. Watching, Inspecting, and Changing Variables
    4. Chapter 4: Traveling About the Stack
      1. Stacking Your Data
      2. Debugging with Advanced Features
  9. Book 5: Advanced Programming
    1. Chapter 1: Working with Arrays, Pointers, and References
      1. Building Up Arrays
      2. Pointing with Pointers
      3. Referring to References
    2. Chapter 2: Creating Data Structures
      1. Working with Data
      2. Structuring Your Data
      3. Naming Your Space
    3. Chapter 3: Constructors, Destructors, and Exceptions
      1. Constructing and Destructing Objects
      2. Programming the Exceptions to the Rule
    4. Chapter 4: Advanced Class Usage
      1. Inherently Inheriting Correctly
      2. Using Classes and Types within Classes
    5. Chapter 5: Creating Classes with Templates
      1. Templatizing a Class
      2. Going Beyond the Basics
      3. Parameterizing a Template
      4. Typedefing a Template
      5. Deriving Templates
      6. Templatizing a Function
    6. Chapter 6: Programming with the Standard Library
      1. Architecting the Standard Library
      2. Containing Your Classes
      3. The Great Container Showdown
      4. Copying Containers
      5. Creating and Using Dynamic Arrays
      6. Working with Unordered Data
      7. Working with Ranges
  10. Book 6: Reading and Writing Files
    1. Chapter 1: Filing Information with the Streams Library
      1. Seeing a Need for Streams
      2. Programming with the Streams Library
      3. Handling Errors When Opening a File
      4. Flagging the ios Flags
    2. Chapter 2: Writing with Output Streams
      1. Inserting with the << Operator
      2. Formatting Your Output
    3. Chapter 3: Reading with Input Streams
      1. Extracting with Operators
      2. Encountering the End of File
      3. Reading Various Types
    4. Chapter 4: Building Directories and Contents
      1. Manipulating Directories
      2. Getting the Contents of a Directory
      3. Copying Files
      4. Moving and Renaming Files and Directories
    5. Chapter 5: Streaming Your Own Classes
      1. Streaming a Class for Text Formatting
      2. Manipulating a Stream
  11. Book 7: Advanced Standard Library Usage
    1. Chapter 1: Exploring the Standard Library Further
      1. Considering the Standard Library Categories
      2. Parsing Strings Using a Hash
      3. Obtaining Information Using a Random Access Iterator
      4. Locating Values Using the Find Algorithm
      5. Using the Random Number Generator
      6. Working with Temporary Buffers
    2. Chapter 2: Working with User-Defined Literals (UDLs)
      1. Understanding the Need for UDLs
      2. Working with the UDLs in the Standard Library
      3. Creating Your Own UDLs
    3. Chapter 3: Building Original Templates
      1. Deciding When to Create a Template
      2. Defining the Elements of a Good Template
      3. Creating a Basic Math Template
      4. Building a Structure Template
      5. Developing a Class Template
      6. Considering Template Specialization
      7. Creating a Template Library
      8. Using Your Template Library
    4. Chapter 4: Investigating Boost
      1. Considering the Standard Library Alternative
      2. Understanding Boost
      3. Obtaining and Installing Boost for Code::Blocks
      4. Creating the Boost Tools
      5. Using Boost.Build
      6. Using Inspect
      7. Understanding BoostBook
      8. Using QuickBook
      9. Using bcp
      10. Using Wave
      11. Building Your First Boost Application Using Date Time
    5. Chapter 5: Boosting up a Step
      1. Parsing Strings Using RegEx
      2. Breaking Strings into Tokens Using Tokenizer
      3. Performing Numeric Conversion
      4. Creating Improved Loops Using Foreach
      5. Accessing the Operating System Using Filesystem
  12. Index
  13. About the Authors
  14. Connect with Dummies
  15. End User License Agreement

Product information

  • Title: C++ All-in-One For Dummies, 4th Edition
  • Author(s): John Paul Mueller
  • Release date: January 2021
  • Publisher(s): For Dummies
  • ISBN: 9781119601746