This is a part of the series of posts which form a basic guide for programming in C++ under Debian based Linux
So, you have finally decided to learn C++ and start your journey to becoming a programmer. Except, you don’t know how to start.
To begin, you will require the ability to compile and run all the code you will be writing. For this we will use the GCC compiler for C++. Fire up your terminal and grab it from apt :
$sudo apt-get update
$sudo apt-get install g++
I like all of my C++ programs to sit in one place. We make a nice directory for that.
Now, we are finally going to write and compile our first program: the Hello,World!
Fire up your favorite text editor and type in the following code for Hello World:
using namespace std;
Save the file as “hello.cpp” in your c++ folder.
To compile and run the program, fire up your terminal :
$g++ -Wall -Werror hello.cpp -o hello.exe
Congratulations! You have just run your first piece of code! The gods of programming will be pleased.
- So Fell He
- Running Windows 3.1 on DOSBox