By Jegathesan | February 27, 2015 [Innovation Begins Here]
Why C is the powerful language?
Why C should be first language to learn?
This is was the same question I asked myself when I started writing my first program. I tried many languages but finally I came to C, the most beautiful and charming language of all. I was literally blown away by the simplicity and elegance of C.
Any person wants to become a software developer must start with C.We can say that C is the only language which has won the hearts of programmers all over the world.
Though C is simple it is one of the most powerful languages ever created. In this dynamic IT world new language come every day and get obsolete, so there must be something in the C which has remained there for 4 decades and more and even today there is hardly any language which can match its strength.
We can divide computer language into three types.
1.High Level Language:
This type of language is capable to providing a good programming by using English words.
2.Low Level Language:
This type of language is capable to utilizing the computer resources to the maximum extent, Such languages can interact with hardware of the machine directly and can control the memory and the processor.
3.Low Level Language:
Low level language are suitable for developing software that interact with the hardware. Both these features are available in C and hence C is the MIDDLE LEVEL LANGUAGE.
The C language developed by Dennis Ritchie in 1972. Don’t read too much history, this information enough for interview point of view.
C language properties:
1.Middle level language.
2.Procedure oriented language.
4.General purpose programming language.
#include<stdio.h> ——————-> Preprocessor Directive
int a=10; ——————->Global Variable
Main() ——————->Main Function
int b=10; ——————->Local Variable
#include -> It is an instruction from the user to the computer for including the Standard library (Printf,scanf)into the source code.
<conio.h> ->This is called header file, It contain declaration of some predefined function.
Global Variable ->When a variable is declared above the main ,its called ‘Global Variable’.It is available whole the program.
Local Variable ->When a variable is declared inside a block or function,its called ‘Local Variable’.It is available only within the block or function.
Main() ->main() function is the starting point of execution of a program. Every program should have main function.
Compilation internal process:
Step 1: [file.c ] Your program end with .C that is the source file written by high or middle level language.
Internal Process: Replacement of preprocessor directive for example when you declare Macros,include the replacement will be happen here.
Step 2:[file.i] Intermediated file.
Internal Process: Compiler is a system utility, first it will check the error after that it will generate the .O (Object File).
Step 3:[file.o] Object File
Internal Process: Linker is a system utility, it will link the source file with definition of standard library function. Header File is nothing but declaration internally it having some definition that will be link here. Then it will generate the Executable file.
Step 4:[a.out] Executable file stores in secondary memory as a image.
Internal Process: Loader load the image file from the secondary memory and will be display.