C++: Basic Concepts: Getting the Tools: Getting the Tools(Part 2)

Getting The Tools
To create a project, open Code::Blocks and click "Create a new project" (or File->New->Project). This will open a dialog of project templates. Choose Console application and click Go.

Go through the wizard, making sure that C++ is selected as the language. Give your project a name and specify a folder to save it to.

Make sure the Compiler is selected, and click Finish. GNU GCC is one of the popular compilers available for Code::Blocks. On the left sidebar, expand Sources. You'll see your project, along with its source files. Code::Blocks automatically created a main.cpp file that includes a basic Hello World program (C++ source files have .cpp, .cp or .c extensions).

Click on the "Build and Run" icon in the toolbar to compile and run the program.

A console window will open and display program output.

Congratulations! You just compiled and ran your first C++ program!

Note: You can run, save, and share your C++ codes on our Code Playground, without installing any additional software. Reference this lesson if you need to install the software on your computer.