Friday 3 February 2012

Preprocessor Directives

Dear Visitors,
      In our earlier post we give you knowledge about the Basic Structure of C program. Today we are going to share with you knowledge about the Preprocessor Directives and also tell you its importance in C program.


SO FRIENDS LETS START OUR LESSON
  • Preprocessor Directives:-
The commands that give instructions to the C compiler are called preprocessor directives. They are given at the beginning of the source code. The preprocessor directives are also known as compiler directives.
                            A preprocessor directive begins with a # sign followed by a word "include" or "define". It is an instruction or directive that tells the C compiler to take action(s) before compiling the source code.
                             The part of the C compiler that takes action on the preprocessor directives is called preprocessor. It does some processing before the actual compilation process starts.
  • For Example:-
                                    "include" directives is used to include header file in the C program. This preprocessor directive includes the specified header file into the source code before compiling. It must be noted that preprocessor directive does not end with semicolon (;).
The most important preprocessor directives are:
  • include directive
  • define directive

2 comments:

  1. Preprocessor directives in c are processed before compilation of source code.
    The C Preprocessor is not part of the compiler but it extends the power of C programming language

    ReplyDelete