The C preprocessor is a macro preprocessor (allows you to define macros) that transforms your program before it is compiled. These transformations can be the inclusion of header file, macro expansions etc.
All preprocessing directives begin with a
# symbol. For example,
#define PI 3.14
Some of the common uses of C preprocessor are:
Including Header Files: #include
#include preprocessor is used to include header files to C programs. For example,
stdio.h is a header file. The
#include preprocessor directive replaces the above line with the contents of
stdio.h header file.
That’s the reason why you need to use
#include <stdio.h> before you can use functions like
You can also create your own header file containing function declaration and include it in your program using this preprocessor directive.