Index
1.Intro, Setup and Tools
2.Underneath The Hood
3.Understanding Our First Program
Introduction
C++ is a programming language used to create high-end applications.
Used by almost all games,(If not all!) C++ is a fine language to learn, especially if you want to become a game developer.
C++ is based on C, but instead of just using functional and procedural programming, it also OOP (Object Orientated Programming).
So in C++ you can program in 3 different paradigms, OOP, procedural and functional.
So if you if your coming over from the programming language C, you'll find this tutorial even easier!!!
*Note: In these tutorials, I will be using a standard POSIX (i.e Linux),
This code should work with Windows but for any specific problems with that Platform, I can't help, Sorry!!!
**Note: I will be using Ubuntu 12.04 for these tutorials
Install the software that is required
Linux:
We use 2 things to make our programs: Our Compiler and a Text Editor.
The text editor I will be using is Gedit as its the default text editor on Gnome and it supports syntax highlighting.
The compiler g++ does come by default on most distros, so we need to do a couple of commands in the terminal:
Code: Select all
sudo apt-get install build-essential
Code: Select all
g++
Code: Select all
sudo apt-get install g++
Code: Select all
g++
***Note: You can set up an IDE (Intergrated Development Enviroment) but its a good learning experience to compile with the terminal. Although if you really want to set up a IDE, I recommend Eclipse.
Windows:
Setting up a compiler in windows is as easy as pie.
Just install an IDE (Intergrated Development Enviroment), I recommend Eclipse.
Checking our Enviroment
Now open your text editor and type this in:
Code: Select all
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World!!!"<<endl;
return 0;
}
Now save it as foo.cppand go onto the terminal.
Now compile it with the command:
Code: Select all
g++ foo.cpp -o foo
Now that was that so hard?
See you on the other side.
<<Prev | Next>>
Advertising