Preprocessor Directives

Preprocessor directives are the special instructions which are executed before code passes through the compilation process.

It begins with hash (#) symbol and do not require semicolon at the end.

One of the most important preprocessor directive is #include which is used for including header file. It is also known as file inclusion. These files contains definition of pre-defined functions like printf(), scanf() etc.

For Example:  
#include<stdio.h>
#Include<stdlib.h>
#include<string.h>

And #define is another commonly used preprocessor directive which is used for creating symbolic constants or for defining macros. It is also known as macro definition.

For Example: 
#define  g  9.81
#define   MIN(a,b)  a<b?a:b





Post a Comment

Previous Post Next Post