fastread homefastrread library fastread menu

C : Flow of C Program

Tutorial by:      Date: 2016-04-27 03:55:03

❰ Previous Next ❱

The C program follows many steps in execution. To understand the flow of C program well, let us see a simple program first.

File: simple.c

  1. #include <stdio.h>  
  2. void main(){  
  3. printf("Hello C Language");  
  4. }  

Let's try to understand the flow of above program by the figure given below.

1) C program (source code) is sent to preprocessor first. The preprocessor is responsible to convert preprocessor directives into their respective values. The preprocessor generates an expanded source code.

2) Expanded source code is sent to compiler which compiles the code and converts it into assembly code.

3) The assembly code is sent to assembler which assembles the code and converts it into object code. Now a simple.obj file is generated.

4) The object code is sent to linker which links it to the library such as header files. Then it is converted into executable code. A simple.exe file is generated.

5) The executable code is sent to loader which loads it into memory and then it is executed. After execution, output is sent to console.

c flow chart

❰ Previous Next ❱


Submit Your Thought, Tutorial, Articls etc.

Submit Your Information India's Number one online promotion website