Setting up Environment for C Programming

Before starting with C programming first, we need a Code writing, running, compiling and executing environment. As we already know that C is a compiled language. That’s why it must need a compiler to be compiled the human-readable code to byte code.

So, first of all, we need a text editor for writing the human-readable source code. Then we need a compatitable compiler to convert the source file to machine-readable bytecode. We can use two kinds of platforms for writing and executing the program for learning purpose. They are:

  • Online Editing Environment
  • Local Editing Environment

Online Editing Environment

Online program editing and executing tools are very handy for learning purpose. You can simply find out online code compilation site for C. The writing the code into the website and executing them into your web browser directly.

In this case, the compiler and text editor actually installed on the web server. So if your internet connection gets slow then the executing time may be late and slow. And the online compiler has many limitations. Most of the complex code can not compile. But it is very handy for compiling the simple code and useful for beginners.

Local Editing Environment

Editing and compiling program code is the best way of executing the output. Because it is your personalized editing, compiling and executing environment. And because of the local environment, it will be very fast to compile and execute without any latency. You can modify the configuration as your own rather than online tools. But in this case, you have to manually install and configure the editor and compiler on your machine.

To create a local environment, 1st you will need a text editor for writing source code. On windows, you can use by default Notepad. Or you can use a more advanced text editor like Notepad++, Atom, Vi or vim, etc. Programs written in C have a file extension of .c. So make sure the file extension is .c (Ex: hello-world.c)

To compile the source code you will need the C/C++ compiler package installed on your machine. The most popular and open source compiler available for C is the GNU C/C++ compiler. Download the compiler and install on your machine. It will create environment for coding in C programming language.

« Previous Next »