Monday, May 26, 2014

How to run a C++ program in CodeBlocks


We can run c programs in Code::Blocks just after installing that. But, to run C++ programs we have to configure Code::Blocks.

Configuring Code::Blocks is not so tough as people think. Follow the steps given below to configure Code::Blocks and to run C++ programs using that.

 Step 01  Run Code::Blocks first
First of all you have to run Code::Blocks. To run it go to Start>All Programs>Code::Blocks. Then simply click on Code::Blocks to run it.

 Step 02  Change the Settings
Now click on Settings from the menu bar, a drop-down menu will open. Now click on Compiler from the menu, a pop-up window will open. Find out the writings Have g++ follow the C++11 ISO C++ language standard [-std=c++11] and check the box showing at the beginning of this line. Then click on the OK button.

 Step 03  Compile a C++ program now
To write a new C++ program, go to File>New>Empty file or simply press Ctrl+Shift+N, a new empty file will open. Now type a simple C++ program and press F9 function key. Then a pop-up window will open to save the program. Save the program with .cpp extension.


Advertisement

No comments:

Post a Comment