
Tutorial overview
It's about choosing the right CodeBlocks for your learning and configuring the system environment variable. First, we have to install CodeBlocks with MinGW and edit the environment variable for that.
Install Proper Code::Blocks
We have to install Code::Blocks with the MinGW. To do that, go to Code::Blocks download, then download the "codeblocks- (Current version number) mingw-setup.exe."

After downloading, you have to install it. It is better to install it in the system default drive. Check everything when you are installing Code::Blocks. After installing, you can run a Hello World program to check if it's working or not.
Environment Variable Setup
You must set the environment variable to access the MinGW from your system drives. Before doing this, you should check if it already exists or not. To do that, open your command prompt and run the command 'gcc --version', and it gives any version-related info that means it's already there. Otherwise, you have to set the GCC accessible from anywhere. Here is the steps you have to follow:
- First, go to the Program Files (of the drive where you installed the Code::Blocks, in default, you will find it in the C drive)
- Go to CodeBlocks> MinGW> bin
- Copy the path

After copying, the path will look like that "C:\Program Files\CodeBlocks\MinGW\bin". To set that path as an environment variable, search 'Edit the system environment variables' in the windows search bar.

Then go to the 'Environment Variables', select 'path', and click on the 'edit'

Now you have to set the path you copied from the file explorer previously. Then hit save and ok.

Then you can open the CMD and run the 'gcc --version' command to check if the GCC is working correctly.

If it shows the version number, then your work is done. Now create a folder and files from anywhere on your computer, and you will be able to run the code. Because your system now knows from where to pull the MinGW and also files for running that C/C++ code.