Programming in C: Unit I (d): Preprocessor Directives

Types of Preprocessor Directives

Programming in C

We can broadly categorize the preprocessor directives into two groups-conditional and unconditional preprocessor directives.

TYPES OF PREPROCESSOR DIRECTIVES

We can broadly categorize the preprocessor directives into two groups-conditional and unconditional preprocessor directives. Figure 10.1 shows the categorization of preprocessor directives.

The conditional directives are used to instruct the preprocessor to select whether or not to include a chunk of code in the final token stream passed to the compiler. Such directives comprise directives such as #if, #else, #elif, #ifdef, #ifndef, and #endif.

The unconditional directives such as #define, #line, #undef, #include, #error, and #pragma perform well- defined task. In this chapter we will learn about all these directives in detail.

Programming in C: Unit I (d): Preprocessor Directives : Tag: : Programming in C - Types of Preprocessor Directives