Rogers Cadenheadis a writer, computer programmer, and web developer who has written more than 25 books on Internet-related topics, including
Sams Teach Yourself Java in 21 Daysand
Absolute Beginner’s Guide to Minecraft Mods Programming. He publishes the Drudge Retort and other websites that receive more than 22 million visits a year. This book’s official website is at
http://cplusplus.cadenhead.org.
Jesse Libertyis the author of numerous books on software development, including best-selling titles on C++ and .NET. He is the president of Liberty Associates, Inc. (www.libertyassociates.com), where he provides custom programming, consulting, and training.
Introduction 1
PART I: BEGINNING C++
Hour 1: Writing Your First Program 5
Using C++ 5
Compiling and Linking the Source Code 6
Creating Your First Program 7
Hour 2: Organizing the Parts of a Program 13
Reasons to Use C++ 13
The Parts of a Program 17
Comments 19
Functions 20
Hour 3: Creating Variables and Constants 27
What Is a Variable? 27
Defining a Variable 32
Assigning Values to Variables 33
Using Type Definitions 34
Constants 36
Auto-Typed Variables 38
Hour 4: Using Expressions, Statements, and Operators 43
Statements 43
Expressions 44
Operators 45
If-Else Conditional Statements 52
Logiclc#