Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Bruce Sutherland
C++ Recipes: A Problem-Solution Approach
Cover
Title
Copyright
Contents at a Glance
Contents
About the Author
About the Technical Reviewers
Acknowledgments
Introduction
Chapter 1: Beginning C++
Recipe 1-1. Finding a Text Editor
Problem
Solution
Recipe 1-2. Installing Clang on Ubuntu
Problem
Solution
How It Works
Recipe 1-3. Installing Clang on Windows
Problem
Solution
How It Works
Recipe 1-4. Installing Clang on OS X
Problem
Solution
How It Works
Recipe 1-5. Building Your First C++ Program
Problem
Solution
Recipe 1-6. Debugging C++ programs using GDB in Cygwin or Linux
Problem
Solution
How It Works
Recipe 1-7. Debugging Your C++ Programs on OS X
Problem
Solution
How It Works
Recipe 1-8. Switching C++ Compilation Modes
Problem
Solution
How It Works
Recipe 1-9. Building with the Boost Library
Problem
Solution
How It Works
Chapter 2: Modern C++
Recipe 2-1. Initializing Variables
Problem
Solution
How It Works
Recipe 2-2. Initializing Objects with Initializer Lists
Problem
Solution
How It Works
Recipe 2-3. Using Type Deduction
Problem
Solution
How It Works
Recipe 2-4. Using auto with Functions
Problem
Solution
How It Works
Recipe 2-5. Working with Compile Time Constants
Problem
Solution
How It Works
Recipe 2-6. Working with Lambdas
Problem
Solution
How It Works
Recipe 2-7. Working with Time
Problem
Solution
How It Works
Recipe 2-8. Understanding lvalue and rvalue References
Problem
Solution
How It Works
Recipe 2-9. Using Managed Pointers
Problem
Solution
How It Works
Chapter 3: Working with Text
Recipe 3-1. Representing Strings in Code Using Literals
Problem
Solution
How It Works
Recipe 3-2. Localizing User Facing Text
Problem
Solution
How It Works
Recipe 3-3. Reading Strings from a File
Problem
Solution
How It Works
Recipe 3-4. Reading the Data from an XML File
Problem
Solution
How It Works
Recipe 3-5. Inserting Runtime Data into Strings
Problem
Solution
How It Works
Chapter 4: Working with Numbers
Recipe 4-1. Using the Integer Types in C++
Problem
Solution
How It Works
Recipe 4-2. Making Decisions with Relational Operators
Problem
Solution
How It Works
Recipe 4-3. Chaining Decisions with Logical Operators
Problem
Solution
How It Works
Recipe 4-4. Using Hexadecimal Values
Problem
Solution
How It Works
Recipe 4-5. Bit Twiddling with Binary Operators
Problem
Solution
How It Works
Chapter 5: Classes
Recipe 5-1. Defining a Class
Problem
Solution
How It Works
Recipe 5-2. Adding Data to a Class
Problem
Solution
How It Works
Recipe 5-3. Adding Methods
Problem
Solution
How It Works
Recipe 5-4. Using Access Modifiers
Problem
Solution
How It Works
Recipe 5-5. Initializing Class Member Variables
Problem
Solution
How It Works
Recipe 5-6. Cleaning Up Classes
Problem
Solution
How It Works
Recipe 5-7. Copying Classes
Problem
Solution
How It Works
Recipe 5-8. Optimizing Code with Move Semantics
Problem
Solution
How It Works
Chapter 6: Inheritance
Recipe 6-1. Inheriting from a Class
Problem
Solution
How It Works
Recipe 6-2. Controlling Access to Member Variables and Methods in Derived Classes
Problem
Solution
How It Works
Recipe 6-3. Hiding Methods in Derived Classes
Problem
Solution
How It Works
Recipe 6-4. Using Polymorphic Base Classes
Problem
Solution
How It Works
Recipe 6-5. Preventing Method Overrides
Problem
Solution
How It Works
Recipe 6-6. Creating Interfaces
Problem
Solution
How It Works
Recipe 6-7. Multiple Inheritance
Problem
Solution
How It Works
Chapter 7: The STL Containers
Recipe 7-1. Storing a Fixed Number of Objects
Problem
Solution
How It Works
Recipe 7-2. Storing a Growing Number of Objects
Problem
Solution
How It Works
Recipe 7-3. Storing a Set of Elements that Is Constantly Altered
Problem
Solution
How It Works
Recipe 7-4. Storing Sorted Objects in a Container that Enables Fast Lookups
Problem
Solution
How It Works
Recipe 7-5. Storing Unsorted Elements in a Container for Very Fast Lookups
Problem
Solution
How It Works
Chapter 8: The STL Algorithms
Recipe 8-1. Using an iterator to Define a Sequence within a Container
Problem
Solution
How It Works
Recipe 8-2. Calling a Function on Every Element in a Container
Problem
Solution
How It Works
Recipe 8-3. Finding the Maximum and Minimum Values in a Container
Problem
Solution
How It Works
Recipe 8-4. Counting Instances of a Value in a Sequence
Problem
Solution
How It Works
Recipe 8-5. Finding Values in a Sequence
Problem
Solution
How It Works
Recipe 8-6. Sorting Elements in a Sequence
Problem
Solution
How It Works
Chapter 9: Templates
9-1. Creating a Template Function
Problem
Solution
How It Works
9-2. Partially Specializing a Template
Problem
Solution
How It Works
9-3. Creating Class Templates
Problem
Solution
How It Works
9-4. Creating Singletons
Problem
Solution
How It Works
9-5. Calculating Values at Compile Time
Problem
Solution
How It Works
Chapter 10: Memory
10-1. Using Static Memory
Problem
Solution
How It Works
10-2. Using Stack Memory
Problem
Solution
How It Works
10-3. Using Heap Memory
Problem
Solution
How It Works
10-4. Using Automated Shared Memory
Problem
Solution
How It Works
10-5. Creating Single-Instance Dynamic Objects
Problem
Solution
How It Works
10-6. Creating Smart Pointers
Problem
Solution
How It Works
10-7. Debugging Memory Problems by Overloading new and delete
Problem
Solution
How It Works
10-8. Calculating Performance Impacts of Code Changes
Problem
Solution
How It Works
10-9. Understanding the Performance Impacts of Memory Choices
Problem
Solution
How It Works
10-10. Reducing Memory Fragmentation
Problem
Solution
How It Works
Chapter 11: Concurrency
11-1. Using Threads to Execute Concurrent Tasks
Problem
Solution
How It Works
11-2. Creating thread Scope Variables
Problem
Solution
How It Works
11-3. Accessing Shared Objects Using Mutual Exclusion
Problem
Solution
How It Works
11-4. Creating Threads that Wait for Events
Problem
Solution
How It Works
11-5. Retrieving Results from a Thread
Problem
Solution
How It Works
11-6. Synchronizing Queued Messages between Threads
Problem
Solution
How It Works
Chapter 12: Networking
12-1. Setting Up a Berkeley Sockets Application on OS X
Problem
Solution
How It Works
12-2. Setting Up a Berkeley Sockets Application in Eclipse on Ubuntu
Problem
Solution
How It Works
12-3. Setting Up a Winsock 2 Application in Visual Studio on Windows
Problem
Solution
How It Works
12-4. Creating a Socket Connection between Two Programs
Problem
Solution
How It Works
12-5. Creating a Networking Protocol between Two Programs
Problem
Solution
How It Works
Chapter 13: Scripting
13-1. Creating a Lua Library Project in Visual Studio
Problem
Solution
How It Works
13-2. Creating a Lua Library Project in Eclipse
Problem
Solution
How It Works
13-3. Creating a Lua Project in Xcode
Problem
Solution
How It Works
13-4. Using the Lua Programming Language
Problem
Solution
How It Works
13-5. Calling Lua Functions from C++
Problem
Solution
How It Works
13-6. Calling C Functions from Lua
Problem
Solution
How It Works
13-7. Creating Asynchronous Lua Functions
Problem
Solution
How It Works
Chapter 14: 3D Graphics Programming
14-1. An Introduction to GLFW
Problem
Solution
How It Works
14-2. Rendering a Triangle
Problem
Solution
How It Works
14-3. Creating a Textured Quad
Problem
Solution
How It Works
14-4. Loading Geometry from a File
Problem
Solution
How It Works
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Title
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset