What Is C Processor?

If there is a constant appearing in several places in your program.it's a good idea to associate a symbolic name for the constant, and then use the symbolic name to replace the constant throughout the program. There are two advantages in doing so. First, the program will be more readable. Second, Easier to maintain.

program.  For instance, the value of the constant needs to be changed, Find the statement that associates the constant with the symbolic name and replaces the constant with the new one. Without using the symbolic name, you have to look everywhere in your program to replace the Constant.

C has a special program called to C processor who allows the programmer to define and associate symbolic names with constant. In fact, the C Processor uses the Terminology macro names and macro body to refer to the symbolic names and the constant. The C Coprocessor runs before the compiler. During Prepossessing, the operation to replace a macro name with its associated macro body is called macro substitution or macro expansion.

 In addition, the C Processor gives you the ability to include other source files. For instance, We've been using the preprocessor directive #include to include C header files. such as studio.h ,studio.h and string.h in the Programs  also, the C Preprocessor enables to compile different sections of the program under specified conditions.

                                                                  (OR)

 Preprocessor is a Programe which executed automatically before passing source program to the compiler Processioning is under control of Processor directives.



Preprocessor directives are classified into four types :

1. Micro Substitution Directives
    Example  #define.

2. File Inclution Directives
    Example  #include

3. Conditional Directives
     Example #if, #else, #else if, #end if, #ifdef, # ifindef, #undef

 4. Misslenious  Directives
     Example #error, #line, #progma



2 comments:

Shah
4 May 2013 at 22:47 comment-delete

i love it thank you very much

Reply
tetst
4 May 2013 at 22:58 comment-delete

welcome!!

Reply

Post a Comment

Don't Forget to comment