Execution of c program.
by Shivu on Jan.26, 2010, under C Language Data Strucutres
Execution of c program.
We have seen the basic structure of c program. It is essential to know the working and execution of c program to master the c language .
Creating a c program :
The programs are written in c editors like turbo C ,TC ,Borland c and then the file is saved with extension as .c . The c editors will by default save this in the form of a .c file . This program written by the programmer is called source code.
Compiling
The source code is in high level language which a computer cannot understand .As we have discussed before , compiler takes the responsibility of translating high level language to low level language. First it searches for any errors in the source code then it is converted into object file name .obj. If there are any errors then it will prompt the programmer to correct it .
Linking a program :
This is an essential process.Since c language is a structured language its power comes from the “block” These blocks may be included in the same file or another file which is included in the header file section . It will combine all the code necessary to run the program and finally creates an executable file .
Executing a c program :
when we run the .exe file the object code is loaded into the main memory and the execution of c program starts .