#include< iostream.h >                              //header file:including instructions
void main(void)                                                   //prototype of main function
{                                                               //start of main function body
cout<<"Hello Every body\n";                      //statements inside the main function
cout<<"Welcome to the programming\n";                      //cout: displays output
cout<<"This is my first C program\n";        // \n: used to move cursor to new line
}                                                                      //End of main body


Making an .exe File 

After you have written the source file for your program, you need to turn it into an executable file. This is called “Making” the .exe file 

Compiling


The version of program you have typed in is understandable to humans. However it is not understandable to to the microprocessor in your computer.
A program that has to be executed by the processor must be in the form of machine language file. Thus there must be two versions of C program which are as follows:
The one which you type in which is called source file and other is the machine language version which is called executable or sometime called binary file.
The compiler which is part of IDE translates this source code into another file, consisting of machine language. 
 
Linking
 
There is another step on most compiled languages including Turbo C and Borland C : a process called Linking. Linking is necessary for several reasons. First, your program needs to be combined with other library routines. As we noted these are functions that performs tasks such as input/output. Library routines are stored in files with .lib extension 
Secondly you may not want to compile all of your program at the same time. Larger C programs commonly consists of several separate files, some of which may already be compiled . The linker combines these files into a single executable file. 
Like the compiler the linker is built into Turbo C’s IDE. The compiler generates an intermediate kind of file called an object file. The linker then links all the necessary object files together to produce a final executable program.

Compiling and Linking in IDE


In Turbo C compiling and linking can be performed together in one step. There are two ways to do this. 
You can select Make EXE file from the compile menu or you can press the F9 key.

Posted by IRFAN Saturday, April 3, 2010

0 comments

Post a Comment