How C Processor Works | Processing of Preprocessor Directives with Flowchart
Working of Pre-processor Directive
Explanation of Working :
Step 1 : Writing c Program
#include<stdio.h> #include<conio.h> #define MAX 10 void main() { int i = MAX; printf("Age of Child : %d",MAX); getch(); }
Suppose we have written above C Program.(hello.c)
Step 2 : Is there any C Preprocessor Directive ?
- Pre-processor means (Pre Pocess : Process it first).
- Preprocessor directives are processed before giving source code to Compiler.
- First Preprocessor will check whether given source code contain any preprocesssor directive or not.
- Yes,We have preprocessor directives in our code. so preprocessor will modify original source code and make it compiler readable.
- Preprocessor does different functions , [Tasks Performed by Preprocessor]
- After Pre-processor Phase modified program is -
void main() { int i = 10; printf("Age of Child : %d",10); getch(); }
Step 3 : Compiler Phase
- Compiler will compile program , creates object code.
Conclusion : Preprocessor Directives
- Preprocessor Processes Source Code before giving it to compiler.
- It is Compiler Independent.


