Series 1 Lesson Plan
Outline
1.1: Implementing a Greeter
- Covers standard library console input and output
- Introduces functions — main, greet
- Introduces types — std::string
- Introduces variables — name
- Introduces classes — Greeter
- Introduces refactoring
Steps
1.1: Implementing a Greeter
Create main()
Explain the concept of a function
Explain the concept of a type
Explain main's oddities - function signature and implicit return.
Build and run first program (does nothing).
Super high-level synopsis — "Code => [Build Process] => Runnable Executable"
VS2005 Shortcuts:
Ctrl+Shift+B — Build
F5 — Run (with debugging and immediate window close)
CTRL+F5 — Run (without debugging, keeps window open)
Write hello world.
std, cout, endl — "Standard Library", "Console Out", "End Line"
Quotes for strings, and backslashes.
Your first error, and what it means.
#include <iostream> — a word on <iostream.h> and old resources.
Write hello ${name}.
string — a way to store names.
cin and getline.
page revision: 0, last edited: 11 Dec 2006 10:39