C PROGRAMMING ENVIRONMENT SETUP

2. ENVIRONMENT SETUP


Try it Option Online

            You really do not need to set up your own environment to start learning C programming language. The reason is very simple, we already have set up C Programming environment online, so that you can compile and execute all the available examples online at the same time when you are doing your theory work. This gives you confidence in what you are reading and to check the result with different options. Feel free to modify any example and execute it online.

Try the following example using our online compiler option available in Coding Area.


#include<stdio.h>
int main()
{
/* my first program in C */
printf("Hello, World! \n");
return 0;
}

For most of the examples given in this tutorial, you will find the Try it option in our website code sections at the top right corner that will take you to the online compiler. So just make use of it and enjoy your learning.



Local Environment Setup

If you want to set up your environment for C programming language, you need the following two software tools available on your computer, (a) Text Editor and (b) The C Compiler.



Text Editor

This will be used to type your program. Examples of a few editors include Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim or vi.
The name and version of text editors can vary on different operating systems. For example, Notepad will be used on Windows, and vim or vi can be used on Windows as well as on Linux or UNIX.
The files you create with your editor are called the source files and they contain the program source codes. The source files for C programs are typically named with the extension ".c".
Before starting your programming, make sure you have one text editor in place and you have enough experience to write a computer program, save it in a file, compile it and finally execute it.



The C Compiler

The source code written in the source file is the human-readable source for your program. It needs to be "compiled" into machine language so that your CPU can actually execute the program as per the instructions are given.

The compiler compiles the source codes into final executable programs. The most frequently used and free available compiler is the GNU C/C++ compiler, otherwise, you can have compilers either from HP or Solaris if you have the respective operating systems.

The following section explains how to install GNU C/C++ compiler on various OS. m We keep mentioning C/C++ together because GNU GCC compiler works for both C and C++ programming languages.



Installation on Windows
To install GCC on Windows, you need to install MinGW. To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program, which should be named MinGW-<version>.exe.
While installing MinGW, at a minimum, you must install GCC-core, gcc-g++, Binutils, and the MinGW runtime, but you may wish to install more.
Add the bin subdirectory of your MinGW installation to your PATH environment variable, so that you can specify these tools on the command line by their simple names.
After the installation is complete, you will be able to run gcc, g++, ar, ranlib, dlltool, and several other GNU tools from the Windows command line.

Comments

Popular posts from this blog

cdac ccat study material

c programming overview

c programming basic syntax