更新时间:2021-06-10 18:29:32
coverpage
Title Page
About Packt
Why Subscribe?
Packt.com
Contributors
About the Authors
About the Reviewers
Packt Is Searching for Authors Like You
Preface
Who This Book Is For
What This Book Covers
To Get the Most out of This Book
How to generate projects for Visual Studio 2017
Download the Example Code Files
Download the color images
Conventions Used
Get in Touch
Reviews
Understanding Language Features
Writing C++
Using whitespace
Formatting Code
Writing Statements
Working with Expressions
Using the Comma Operator
Using Types and Variables
Using constants and literals
Defining constants
Using Constant Expressions
Using Enumerations
Declaring Pointers
Using Namespaces
C++ Scoping of Variables
Using Operators
Exploring the Built-in Operators
Arithmetic Operators
Increment and Decrement Operators
Bitwise Operators
Boolean Operators
Bitwise Shift Operators
Assignment Operators
Controlling Execution Flow
Using Conditional Statements
Selecting
Looping
Looping with Iteration
Conditional Loops
Jumping
Using C++ language features
Summary
Working with Memory Arrays and Pointers
Using memory in C++
Using C++ pointer syntax
Using Null Pointers
Types of Memory
Pointer Arithmetic
Using Arrays
Function parameters
Multidimensional Arrays
Passing Multidimensional Arrays to Functions
Using arrays of characters
Comparing strings
Preventing Buffer Overruns
Using Pointers in C++
Accessing out of Bounds
Pointers to Deallocated Memory
Converting Pointers
Constant Pointers
Changing the Type Pointed To
Allocating memory in code
Allocating individual objects
Allocating Arrays of Objects
Handling failed allocations
Using Other Versions of the New Operator
Memory lifetime
The Windows SDK and Pointers
Memory and the C++ Standard Library
Standard Library arrays
Using the stack-based array class
Using the Dynamically Allocated Vector Class
References
Constant References
Returning References
Temporaries and References
The rvalue References
Ranged for and References
Using Pointers in Practice
Creating the Project
Adding a Task Object to the List
Deleting the task list
Iterating the task list
Inserting Items
Using Functions
Defining C++ functions
Declaring and defining functions
Specifying linkage
Inlining
Determining the return type