Starting your C++ training

Hello! Today I want to talk about C++. The main things that I will cover in this tutorial is how to create a new project and how to create your first program.

First of all , in order to learn  C++ you should have installed an IDE, i talked about them in a previous post of mine. To save you the trouble of going back and take a look I’ll tell you what I am talking about. IDE stands for Integrated Development Environment and that’s basically the place where you’ll be writing and compiling your code. For C++ I strongly recommend using Code::Blocks as your IDE.

Good,now let’s suppose you had installed code::blocks and you are ready to go.Open it up and it should look like this :

wordpress codeblocks

Code::Blocks interface

Go ahead and press on the “Create a new project button”,this should open a window where you have to select a template, choose console application

Capture

Selecting template

After you had selected your template press go ,select C++ and name your project. In the left side of the windows you will have a tab that’s called projects.Inside you will find your Workspace where you’ll see the name of your project. Double click it and then go inside sources and double click your main.cpp. The standard template will appear before you and it looks something like this

#include <iostream>

using namespace std;

int main ()
{
cout << “Hello world!” << endl;
return 0;
}

This code will open your console and will open the console and will show the message “Hello world!” or whatever you choose to type between the quotation marks inside. After that you can click on the build menu at the top of your window and click Build and run ,or if you are a person that likes shortcuts more you can press F9,  this will compile and run your program.

I hope you enjoyed it! Keep on coding 😉 !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s