Tuesday, December 7, 2010

Necessary steps to prepare a C Program

CREATING AND EDITING A C PROGRAM:
The first step is to create and edit a new program. It includes writing, modifying and deleting program statements. This process is performed by using text editor like Note Pad, wordpad etc. Most compliers provide a text editor for writing code of C programs.
SAVING A C PROGRAM:
The process of storing the program on disk is known as Saving. A program should be saved on disk to be used repeatedly. The C program is saved with .c extension.
COMPILING A C PROGRAM:
The process of converting source program into object program is known as compiling. The program saved with .c extension contains the statement of C language. It is known as source program. The source program cannot be executed by computer directly. A compiler converts the source program into object program and saves it in a separate file. The object program is saved with .obj extension. The source program cannot be compiled if it contains any syntax error. The compiler generates error message to describe the cause of error. All error mus be removed to successfully compile a source program.
LINKING A C PROGRAM: 
The process of linking library files with object program is known as linking. These files are used to accomplish different tasks such as input / output. A library file must be linked with the object file before execution of program. A program that combines the object program with additional library files is known as linker. It is part of C++ compiler. The linker generates error message if the library file does not exist. A new file is created with .exe extension if the process of linking is successful. This file is known as executable file and can be executed by the computer directly.
LOADING A C PROGRAM:
In this step, the loader loads the executable file into the memory for execution. A program must be loaded in the memory in order to execute it. A program that places an executable file in the memory is known as loader.
EXECUTING A C PROGRAM:
The process of running a executable file is known as executing. The C++ program can be execuated after compiling and linking. In this last step, the program is executed. The instructions written in the program are executed by the computer.

No comments:

Post a Comment