Introduction
CodeBlocks is a cross-platform (Linux, Mac, Windows (uses wxWidgets)), open-source, free IDE that supports GCC, Visual C++, and Clang compilers.
CodeBlocks is a powerful IDE for creating, compiling, executing and debugging C/C++ programs.
Please read previous post : How To Install CodeBlocks IDE on Windows
Create C Project In CodeBlocks
- Open CodeBlocks, go to Start Menu > All Apps > CodeBlocks > CodeBlocks.
- Click on the File menu, select New > Project….
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-1.jpg)
- From the New form template window select “Console application” and click the “Go” button.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-2.jpg)
- If you see a welcome message, click the “Next >” button to skip the welcome message.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-3.jpg)
- On the next window, select your language from Console application window and click the “Next >” button.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-4.jpg)
- On the next window,
- Type “Project_1” in the Project title Text Field to change Project Name.
- Click the “ellipsis” button present under Folder to create project in. Browse your C workspace, mention the file name click Finish. Navigate to save project directory (ex: D:\Program\Algortihm).
- Click the “Next >” button.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-5.jpg)
- On the next window, click the “Finish” button.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-6.jpg)
- Now in the left side of the screen go to Projects in the “Management” sub-window. Expand your new project and its folder “Sources“. You will see that CodeBlocks.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-7.jpg)
Compile and run C program in CodeBlocks
Once you created your first C Project, You see? The “hello-world” code is already there. It is time to compile and run your first C program.
- Go to menu Build > “Build and Run” or just press F9 and then OK, when you are asked if you want to build the project.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-8.jpg)
- A console will open and you will see the greeting on the screen.
![codeblocks project](https://sidiq.mercubuana-yogya.ac.id/wp-content/uploads/2018/02/codeblocks-project-9.jpg)
Thanks for reading!