About Me Projects Articles /misc Table of Contents C Pre-Processor Magic The humble #define If-statements Pattern Matching Cast to bool!! (and negation) Iterators Forcing CPP to make multiple passes Turning multiple expansion passes into recursion Turning recursion into an iterator Learning More The C Pre-Processor (CPP) is the somewhat basic macro system used by the C programming language to implement features such as #include and #define which allow very simple text-substitutions to be carried out at compile time. In this article we abuse the humble #define to implement if-statements and iteration. Before we begin, a disclaimer: these tricks, while perfectly valid C, should not be considered good development practice and should almost certainly not be used for "real work". That said it can totally be used for fun home-automation projects ... Most C programmers...