CHAPTER 25 / 26
C Preprocessor
Learn the role of #include, #define and other preprocessor directives.
01 — Syntax
#include <stdio.h>\n#define NAME value
02 — Example
#include <stdio.h>
#define AIFA_NAME "AIFA Infotech"
int main() {
printf("%s", AIFA_NAME);
return 0;
}03 — Important Points
- Preprocessor directives begin with #.
- Macros are replaced before compilation.
04 — Common Mistakes
- Putting normal statements in a place where a preprocessor directive is expected.
- Overusing macros.
05 — Real-World Use
The preprocessor supports headers, conditional compilation and compile-time configuration.
06 — Practice
Create a small program that demonstrates the main idea of C Preprocessor.