“Trying to outsmart a compiler defeats much of the purpose of using one” Brian Kernighan
As mentioned in compiler-section programming languages have their own compiler and C is no exception.
So in order to write C code and run it, you need C compilers.
If you’re using Microsoft Operating Systems like Windows-10 etc., there are two popular compilers and you can use each one of them in order to compile your C-code.
-
Cygwin, which you can download it from the Cygwin official
website at: https://cygwin.com/install.html -
MinGW, which you can download it from the MinGW official website
at: http://www.mingw.org/wiki/Getting_Started
Either of these two compilers is capable of compiling C and C++ source code in Windows operating system.
If you’re using Unix-like operating system like Linux, there’s a chance that a C compiler named GCC (GNU Compiler Collection) is already installed on your system. So in order to check and make sure it is installed, you can open a new terminal and run the code below:
gcc –version
If you get the message like the one below, it means that you have C compiler installed on your system:
gcc (Ubuntu 7.2.0-18ubuntu2) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you don’t have the compiler, you can simply install one by running the code below in your terminal:
sudo apt install build-essential
Now if you run the gcc --version again, you’ll see a message like the one that we showed above.
Also if you’re using Mac OS, you can install the GCC compiler in your system as well.
Check the link below in order to see how to install GCC compiler:
https://discussions.apple.com/thread/5250041?answerId=22771361022#22771361022
After you’ve installed a compiler in your system you need an “Integrated Development Environment” or IDE for short.
The explanation of what an IDE is and why do we need it, is given in the IDE section.