User:Robert Harrison/Introduction to Programming with C++


 * Preparation
 * In order to get the most out of this material the student will need a C++ compiler. Compilers are available from a variety of sources. A short list of of common compilers are
 * GCC (GNU Compiler Collection) - free - available on multiple hosts
 * Dev-C++ - free - available on Windows only
 * Visual C++ - not free - available on Windows only
 * Note that compilers come in varied flavors. Some include a text editor as part of the compiler. Others require a stand-alone text editor. It is recommended but not required that the student obtain a compiler that includes a text editor.


 * Also, an intermediate understand of algebra would be helpful.
 * Wikibooks has a textbook for C++ here. It is still in the development phase, however.


 * Organization
 * In an attempt to make learning C++ more interesting, the lessons will be follow the form of making a text-based role-playing game. This method will allow the student to make multiple versions of a role-playing game, with each version applying new material to make the game richer in content.


 * Text on the page will be formatted in the following way:


 * Source code will follow this style-

foo this


 * And output will follow this style-

Lesson 1: Your first program
What follows is a very basic program that outputs one line of text then closes.

using namespace std; int main {	cout << "Hello World!" << endl; return 0; }
 * 1) include

Output:

For an analysis of the above program read this.

Now, following the RPG purpose of this session. Let's replace "Hello World!" with "Welcome to the Dungeon, Wanderer." or any other text. Here is one way to write it...