Showing posts with label directives of preprocessor. Show all posts
Showing posts with label directives of preprocessor. Show all posts

Saturday, 27 July 2019

What is preprocessor?

The preprocessor is not a part of c compiler. It is an unique feature of c language. Preprocessor is a program that processes the code before it passes through the compiler. Preprocessor makes the program easy to read, modify, portable and more efficient by providing their tools.

Preprocessor directives-

Directives                       Function
#define          defines a macro substitution
#undef           undefines a macro
#include        specifies a file to be included
#ifdef            tests for macro definition
#endef          specifies the end of #if
#ifendef        tests weather the macro                               
                     is not def
#if              tests a compile time condition
#else       specify alternatives when # if  

                 test fail