What is C ?
C is a procedural programming language developed by Dennis Ritchie in 1972 at Bell Laboratories. It is a middle level language and is written using assembly language ( low level language ). C is easy and fun to learn and it is mainly used to develop real time applications. Even though a lot of high level languages like Java and Python has gained popularity but when it comes to performance, C is unbeatable. Major portions of operating systems like Unix, Linux and Windows are written using C. The other real world usage of C includes device drivers, compilers and interpreters, database systems, text editors and may other utilities. A good understanding of the C language elements lays down the foundation to succeed in the world of programming and solid foundation will help you grab advanced concepts like Object Oriented Programming ( OOP ) offered by other languages like C++ and Java. For a skilled C programmer, learning any other programming language is a cakewalk.
About the Tutorial
This tutorial has been prepared for beginners to help them understand the basics of programming. It can also be used by professionals to refresh their skills. Learning is fun & faster when concepts are demonstrated more using examples rather than lines of text. Same guideline is followed while preparing this tutorial. It has been kept precise yet covering every aspect to help you master the language. A solid understanding of the concepts illustrated in different modules of this tutorial will make you a confident and skilled programmer.
C Programming Paradigm
C is structured language which follows a procedural programming paradigm. A large program is divided into small modules called functions or procedures and data moves freely from one function to another. Modularity is a very important concept when it comes to developing a large scale system as it makes understanding and maintenance of complex systems easier. In procedural programming, the prime focus is on implementing the functions that operate on some input data to perform a specific task. The data is considered secondary here. This is where it differs from object oriented programming paradigm in which data is of primary importance and functions that operate on the data are secondary.
C Development Environment Setup
If you are using windows, just download an Integrated Development Environment ( IDE ) like Borland C++ or Dev C++, install it & start writing programs. You can simply google for “C compiler for windows”. You get an integrated development environment with an editor & compiler. Most of these IDEs have support for both C and C++ languages. Write your program, save it with .c extension, compile & run.
On a Linux platform, GCC needs to installed and most of the times it is installed by default on your system. You can use any editor like emac, vim or gedit. Just type your program, save it with .c extension, compile and run.
Compile : On the console, type gcc -o my_program my_program.c ( assuming your program file is saved as “my_program.c ” ).
Run : On the console, type ./my_program.