Home Page Icon
Home Page
Table of Contents for
Index
Close
Index
by Jesse Liberty
Sams Teach Yourself C++ in 24 Hours, Third Edition
Copyright
About the Author
Acknowledgments
Tell Us What You Think!
Introduction
Introducing C++
Getting Started
Preparing to Program
C++, ANSI C++, ISO C++, Windows, and Other Areas of Confusion
Installing and Setting Up the Compiler
Compiling and Linking the Source Code
The Development Cycle
HELLO.CPP—Your First C++ Program
Compile Errors
Summary
Q&A
The Parts of a C++ Program
Why C++ Is the Right Choice
The Parts of a Simple Program
Comments
Functions
Summary
Q & A
Variables and Constants
What Is a Variable?
Defining a Variable
Creating More Than One Variable at a Time
Assigning Values to Your Variables
typedef
When to Use short and When to Use long
Constants
Enumerated Constants
Summary
Q&A
Expressions and Statements
Statements
Expressions
Operators
Combining the Assignment and Mathematical Operators
Increment and Decrement
Precedence
Nesting Parentheses
The Nature of Truth
Relational Operators
The if Statement
Use Braces in Nested if Statements
Logical Operators
Relational Precedence
More About Truth and Falsehood
Summary
Q&A
Functions
What Is a Function?
Declaring and Defining Functions
Local Variables
Global Variables
Function Statements
Function Arguments
Parameters Are Local Variables
Return Values
Default Parameters
Overloading Functions
Summary
Q&A
Program Flow
Looping
while Loops
do...while Loops
for Loops
switch Statements
Summary
Q&A
Classes
Basic Classes
What Is a Type?
Creating New Types
Classes and Members
Accessing Class Members
Private Versus Public
Implementing Class Methods
Constructors and Destructors
Summary
Q&A
More About Classes
const Member Functions
Interface Versus Implementation
Where to Put Class Declarations and Method Definitions
Inline Implementation
Classes with Other Classes as Member Data
Summary
Q&A
Memory Management
Pointers
What Is a Pointer?
Why Would You Use Pointers?
The Stack and the Heap
Summary
Q&A
Advanced Pointers
Creating Objects on the Heap
Deleting Objects
Accessing Data Members Using Pointers
Member Data on the Heap
The this Pointer
What's the this Pointer For?
Stray or Dangling Pointers
const Pointers
Summary
Q&A
References
What Is a Reference?
Creating a Reference
Using the Address of Operator on References
What Can Be Referenced?
Null Pointers and Null References
Passing Function Arguments by Reference
Understanding Function Headers and Prototypes
Returning Multiple Values
Summary
Q&A
Advanced References and Pointers
Passing by Reference for Efficiency
References as an Alternative to Pointers
When to Use References and When to Use Pointers
Don't Return a Reference to an Object That Isn't in Scope!
Returning a Reference to an Object on the Heap
Pointer, Pointer, Who Has the Pointer?
Summary
Q&A
Power Tools
Advanced Functions
Overloaded Member Functions
Using Default Values
Choosing Between Default Values and Overloaded Functions
Overloading Constructors
Initializing Objects
The Copy Constructor
Summary
Q&A
Operator Overloading
Operator Overloading
Conversion Operators
Summary
Q&A
Arrays
What Is an Array?
Array Elements
Writing Past the End of an Array
Fence Post Errors
Initializing Arrays
Arrays of Objects
Multidimensional Arrays
A Word About Memory
Arrays of Pointers
Declaring Arrays on the Heap
A Pointer to an Array Versus an Array of Pointers
Pointers and Array Names
Deleting Arrays on the Heap
char Arrays
strcpy() and strncpy()
String Classes
Summary
Q&A
Inheritance and Polymorphism
Inheritance
What Is Inheritance?
Private Versus Protected
Constructors and Destructors
Overriding Functions
Summary
Q&A
Polymorphism and Derived Classes
Polymorphism Implemented With Virtual Methods
Summary
Q&A
Advanced Polymorphism
Problems with Single Inheritance
Abstract Data Types
Summary
Q&A
Linked Lists
Linked Lists and Other Structures
A Case Study
The Component Parts
What Have You Learned, Dorothy?
Summary
Q&A
Special Topics
Special Classes, Functions, and Pointers
Static Member Data
Static Member Functions
Containment
Friend Classes
Friend Functions
Pointers to Functions
Pointers to Member Functions
Summary
Q&A
The Preprocessor
The Preprocessor and the Compiler
Seeing the Intermediate Form
Using #define
Inclusion and Inclusion Guards
Macro Functions
String Manipulation
Predefined Macros
Summary
Q&A
Object-Oriented Analysis and Design
The Development Cycle
Simulating an Alarm System
PostMaster: A Case Study
Summary
Q&A
Templates
What Are Templates?
Parameterized Types
Template Definition
Using Template Items
The Standard Template Library
Summary
Q&A
Exceptions and Error Handling
Bugs, Errors, Mistakes, and Code Rot
Exceptions
Using try Blocks and catch Blocks
Next Steps
Style
Next Steps
Appendices
Binary and Hexadecimal
Other Bases
Around the Bases
Hexadecimal
Glossary
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
Prev
Previous Chapter
Glossary
Index
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