For the purposes of this tutorial, all of our programs will be console applications; programs that run entirely within the MS-DOS console. Why? Because doing it any other way will require that we discuss some more advanced topics (object oriented programming, specifically). Most programs today are event driven ? that is, they don?t do anything until you click a button or enter some text or what have you. The programs we write here, however, will be sequential. It will run from point A to point B to point C one after another until we tell it to stop. All that said, this is how all of your C++ console applications will look:

#include <iostream.h>
#include <stdlib.h>

int main()
{
	(code goes here)
	system(?pause?);
	return 0;
}

We?ll, of course, get to what all this means at a later date, but for now, we?ll just start throwing our code into this template.

Next on the docket are variables. If you don?t already know, variables are basically embodiments of locations in memory; simply put, they are names under which we can store and recall our data. It isn?t quite that easy, though ? you must specify a type of data that your variable will store. There are approximately 8 different ?primitive? data types that our variables can store, but for the purposes of this tutorial, we?ll only go over the 3 most popular ones that are used in C++.

int
Integer: This data type stores whole numbers in the range of around -3 billion to 3 billion.
double
Double: This data type stores any real number up to roughly 15 digits, decimal values inclusive.
char
Character: This data type stores a single character, or a single escape code (more on that later).

You can pretty much do everything with these 3 data types that you can do with any of the other primitive data types; the only difference is the size they take up in memory.

While C++ may allow you to switch between certain data types ?on the fly,? (for example, a char is actually an integer interpreted differently, so it will let you treat a char like an int and vice-versa), it is horrible convention to do it, and with anything more complex than these 3 data types, it will probably generate a compile error. So don?t do it unless you know what you?re doing.