Saturday
C++How to write and compile a C++ program in Windows using an IDE
In this tutorial I’ll show you how to write and compile a C++ Program using CodeBlocks in Windows. That’s right, Windows.
If you haven’t done so, download and install CodeBlocks
Using CodeBlocks to program Hello World
1. Open up CodeBlocks and simply click on “Create a new project”.

2. In the following window choose Console Application.

3. The next window welcomes you to the application wizard. I’d simply check Skip this Page Next Time and click on Next.

4. Choose C++ project.

5. Type in the appropriate values I have in the following image. If you want, you can change the name of the directory where your project will be saved.

6. For now, simply type in Finish in the next window. No need to change anything.

7. In the Management Tab, Expand Sources, and double click on main.cpp . Unfortunately Hello World is already written for us!

8. Now go to Build -> Build and Run. OR You can simply hit F9 which is the shortcut to build and run your program.

9. Congratulations! You are done!
Useful Resources
C++ Tutorial - Page where our C++ tutorials can be found at.
Hello World - Step by Step telling you what each line of Hello World actually does!


Jun 2, 2008
Reply
Quick tip.
At the top of this tutorial you tell the reader to download code blocks if they don’t have it. If someone has never used code blocks maybe they don’t know how to set it up. It would be really useful if you had a link to a tutorial that teach the user how to set up code blocks.The edit might look something like this:
In this tutorial … That’s right, Windows.
If you haven’t done so, download and install CodeBlocks. If you are not familiar with code blocks click here for a quick guide on how to set it up.
Just a suggestion…
Jun 27, 2008
Reply
If they download the one with the compiler then they should be fine.
Jul 6, 2008
Reply
Thanks, this was very useful.