Tuesday, 10 November 2015

EXECUTING A C-PROGRAM

  1. Creation of program
    • Program should be written in a C editor
    • After typing the program, save it with extension .c
  2. Compilation & linking of a program
    • Source program should be compiled using a C compiler.
    • Compiler checks for the syntax errors.
    • Once all the errors are corrected, compiler converts the source program into its equivalent machine language code called as the Object Program or Object Code
    • The object program is required for execution by the computer
    • Linking is also essential process that puts all other program files and functions, that are required by the program, together                                                 
    • e.g:
      • If the program contains the built in function sqrt(), then the object code of this function should be linked to the main program from math.h library of the system
  3. Executing the program
    • After the compilation and linking, the executable code will be loaded in the computer's main memory and the program is executed


No comments:

Post a Comment