| |
| |
Acknowledgments & Introduction | |
| |
| |
| |
How a C++ Program Works | |
| |
| |
What Is a Computer Program? | |
| |
| |
What Is a Programming Language? | |
| |
| |
Anatomy of a C++ Program | |
| |
| |
Translating the Code for the Computer | |
| |
| |
Using an IDE to Create and Run the "Hello World!" Project | |
| |
| |
Quiz | |
| |
| |
| |
Memory and Data Types | |
| |
| |
Memory | |
| |
| |
Data Types | |
| |
| |
Project: Determining the Size of Data Types | |
| |
| |
Quiz | |
| |
| |
| |
Variables | |
| |
| |
Declaring Variables | |
| |
| |
Assigning Values to Variables | |
| |
| |
Quiz | |
| |
| |
| |
Arithmetic Operators | |
| |
| |
Arithmetic Operators | |
| |
| |
The Change Machine Project | |
| |
| |
Quiz | |
| |
| |
| |
Making Decisions: if and switch Statements | |
| |
| |
Relational Operators | |
| |
| |
Flowcharting | |
| |
| |
The if Statement | |
| |
| |
The if/else Statement | |
| |
| |
The if/else if/else Statement | |
| |
| |
The switch Statement | |
| |
| |
Quiz | |
| |
| |
| |
Nested if Statements and Logical Operators | |
| |
| |
Nested if Statements | |
| |
| |
Logical Operators | |
| |
| |
Using the switch Statement with Logical Operators | |
| |
| |
Quiz | |
| |
| |
| |
The For Loop | |
| |
| |
Increment and Decrement Operators | |
| |
| |
The For Loop | |
| |
| |
Quiz | |
| |
| |
| |
While and Do While Loops | |
| |
| |
The While Loop | |
| |
| |
The Do While Loop | |
| |
| |
Quiz | |
| |
| |
| |
Functions | |
| |
| |
Defining and Calling a Function | |
| |
| |
Variable Scope and Lifetime | |
| |
| |
Sending Information to a Function | |
| |
| |
Returning a Value from a Function | |
| |
| |
Quiz | |
| |
| |
| |
Arrays | |
| |
| |
Declaring an Array | |
| |
| |
Initialization | |
| |
| |
Assigning and Displaying Array Values | |
| |
| |
Passing Arrays as Function Arguments | |
| |
| |
Quiz | |
| |
| |
| |
What's the Address? Pointers | |
| |
| |
Declaring a Pointer | |
| |
| |
Assigning a Value to a Pointer | |
| |
| |
Indirection Operator and Dereferencing | |
| |
| |
The Pointer as a Variable or a Constant | |
| |
| |
Pointer Arithmetic | |
| |
| |
Pointers as Function Arguments | |
| |
| |
Dynamic Memory Allocation | |
| |
| |
Returning Pointers from Functions | |
| |
| |
Quiz | |
| |
| |
| |
Character, C-String, and C++ String Class Functions | |
| |
| |
Reading a Character | |
| |
| |
Useful Character Functions | |
| |
| |
Useful C-String and C++ String Functions | |
| |
| |
Quiz | |
| |
| |
| |
Persistent Data: File Input and Output | |
| |
| |
Text vs. Binary Files | |
| |
| |
The fstream Standard Library | |
| |
| |
The File Access Life Cycle | |
| |
| |
Opening a File | |
| |
| |
Closing a File | |
| |
| |
Writing to a File | |
| |
| |
Reading from a File | |
| |
| |
File Stream Objects as Function Arguments | |
| |
| |
Quiz | |
| |
| |
| |
The Road Ahead: Structures and Classes | |
| |
| |
Your Reasons for Reading This Book? | |
| |
| |
Object-Oriented Programming | |
| |
| |
Structures | |
| |
| |
Classes | |
| |
| |
Quiz | |
| |
| |
Final Exam | |
| |
| |
Answers to Quizzes and Final Exam | |
| |
| |
Index | |