C Preprocessor Directives – #define, #if, #ifdef, #ifndef with Examples

C preprocessor directives are instructions that run before compilation. The preprocessor reads your source file, processes every line that starts with #, and hands the result to the compiler. Understanding them well means smaller code, safer constants, conditional compilation for different platforms, and header files that include safely more than once. Object-Like Macros — #define …