The C programming language supports preprocessors in order to work the program efficiently.C preprocessoris a macro preprocessor for C-based programming languages. The preprocessor provides the compiler with the ability to include header files, macro expansion, conditional compilation, and line control in an explicit manner.
#hashtag is used to define preprocessors, that is, all preprocessors start with #. This is followed by the name of the preprocessor without any spaces. Here is a list of C preprocessors.
S.No. | Preprocessor | Description |
---|---|---|
1. | #include | Include specific header files from a file. |
2. | #define | Define preprocessor macros. |
3. | #undef | Undefine preprocessor macro |
4. | #if | Checks the compile-time condition and evaluates toTruevalue. |
5. | #else | Evaluate as an alternative to if preprocessor . |
6. | #ifndef | Checks whether the macro is defined. If undefined, evaluates to TRUE . |
7. | #elif | Simultaneously combine#ifand#elsestatements. |
8. | #error | Defined bystderrmethod Printed error message. |
9. | #endif | End preprocessor condition. |
10. | #pragma | Used to issue commands to the compiler/ |
The above is the detailed content of C preprocessor?. For more information, please follow other related articles on the PHP Chinese website!