C++ Tutorial 1, Introduction to C++


Introduction to C++

Why Learn C++?

C++ may at first seem like a boring, confusing programming language that you can only program command prompt applications with. Well, that is what it is like in the [b]beginning[/b]. And you are going to need to learn the basics like this with any programming language. As you get better and progress in your C++ skills, you will begin to learn that you can start making some cool applications easier than you thought you could. The main reason to learn C++ though, is that it teaches all the basics of programming and you will learn concepts that will be used in other types of programming. Many other programming languages are like C++ or use C++. For example, PHP, a powerful web development language uses almost the same syntaxes as C++. DirectX, a common game development graphics library primarily uses C++.

Setting up C++

Ill assume that most people are not going to want to spend the money for a compiler, thats fine, there are many great free compilers. I use Dev-C++ because it has some nice features and is fast, and best of all, its FREE!


You can download it here.Download it and install it, this step is pretty easy. During instillation, select all the deafult values during instillation.

Create a New Project:

Go to the top menu: File -> New -> Source File, or just press Ctrl+N

You should now have a text document. Then, write the following text in the document:


using namespace std;

int main()



Tells the compiler that we are going to be using the iostream library, which includes information on things we will be using in the code.

using namespace std;

Saves time by telling the compiler that we are going to be using the ‘std::’ functions, which stands for ‘standard’.

int main()

Starts the main function, this is were the heart of the program is. I will get into what functions are later on.


Starts the main function.



Source link