18-04-2014, 11:58 AM
C Programming Tutorial
The C programming language is a general purpose high level language that was
originally developed by Dennis M. Ritchie to develop the Unix operating system at Bell
Labs. C was originally first implemented on the DEC PDP-11 computer in 1972.
In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available
description of C, now known as the K&R standard.
The UNIX operating system, the C compiler, and essentially all UNIX applications programs
have been written in C. The C has now become a widely used professional language for
various reasons.
Why to use C ?
C was initially used for system development work, in particular the programs that make-up
the operating system. C was adopted as a system development language because it
produces code that runs nearly as fast as code written in assembly language. Some
examples of the use of C might be:
Operating Systems
Language Compilers
Assemblers
Text Editors
Print Spoolers
Network Drivers
Modern Programs
Data Bases
Language Interpreters
Utilities
The C Compiler
The source code written in source file is the human readable source for your program. It
needs to be "compiled", to turn into machine language so that your CPU can actually
execute the program as per instructions given.
This C programming language compiler will be used to compile your source code into final
executable program. I assume you have basic knowledge about a programming language
compiler.
Most frequently used and free available compiler is GNU C/C++ compiler, otherwise you can
have compilers either from HP or Solaris if you have respective Operating Systems.
Following section guides you on how to install GNU C/C++ compiler on various OS. I'm
mentioning C/C++ together because GNU gcc compiler works for both C and C++
programming languages.
Installation on Windows
To install GCC at 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 MinWG, 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.
When 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.