There are many compilers and IDE available for c and c++. You need to download any one. Here, we are going to use Code::Blocks because it will compatible for both c and c++.
Before you install a compiler on your system, you should know what is compiler and interpreter.
A compiler is a computer program that transforms human-readable source code into the machine-readable code that a CPU can execute.
An interpreter is a computer program that directly executes, i.e. performs instructions written in programming or scripting language, without previously compiling them into a machine language program.
- The interpreter takes single instruction as input.
- No intermediate object code is generated.
- The interpreter executes conditional control statements at much slower speed.
- Memory requirement is less.
- Errors are displayed for every instruction interpreted (if any).
List of some good IDE + Compilers for C.
|Code::Blocks with Mingw (we recommend this)|
|Download link: http://codeblocks.org/downloads/binaries|
|Available on: Windows, Linux, Mac|
|Dev C++ With Mingw/GCC|
|Download link: http://www.bloodshed.net/dev/devcpp.html|
|Available on: Windows|
How to install Code::Blocks
Step 1: Go to the binary release download page of Code:Blocks official site.
Step 2: Under Windows XP / Vista / 7 / 8.x / 10 section, click the link with mingw-setup (highlighted row) from Sourceforge.net.
Step 3: Open the Code::Blocks Setup file and follow the instructions Next > I agree > Next > Install. you don’t need to change anything. This installs the Code::Blocks with gnu GCC compiler, which is the best compiler to start with for beginners.
Step 4: Now, open Code::Blocks and go to File > New > Empty file (Shortcut: Ctrl + Shift + N)
Step 5: Write the C code and save the file with .c extension. To save the file, go to File > Save (Shortcut: Ctrl + S). Important: The filename should end with a .c extension, like: hello.c, your-program-name.c
Step 6: To run the program, go to Build > Build and Run (Shortcut: F9). This will build the executable file and run it.
If your program doesn’t run and if you see the error message “can’t find compiler executable in your search path(GNU GCC compiler)”, go to Settings > Compiler > Toolchain executables and click Auto-detect. This should solve the issue in most cases.