Introduction To Preprocessor Directives

2 February 20120 comments

Preprocessor Directives:

Preprocessor, as implied by its name  is a program that processes the source program before passed to the compiler.It provides several unique functions that are not available to other programming languages.The preprocessor operates much like a text editor under the control of preprocessor commands or directives.Directives do not follow the syntax rules for statements instead they have a smaller set of syntax rules ,one of which is that all preprocessor statements must begin with with #. This character is followed by one of the preprocessor commands which are not reserved words.Directives do not rely on the statement termination i.e no semicolon is required at its end.The directives can be placed anywhere in a program but are most often placed at the beginning before main( ).

We should learn the following preprocessor directives :
  1. Macro expansion
  2. File inclusion
  3. Conditional Compilation
  4. Miscellaneous directives




          






Share this article :

Post a Comment

 
Copyright © 2011. All Compiler - All Rights Reserved