Question: how does ifdef work in c++?
Answer: #ifdef means if defined. If the symbol following #ifdef is defined, either using #define in prior source code or using a compiler command-line argument, the text up to the enclosing #endif is included by the preprocessor and therefore compiled. #if works similarly, but it evaluates the boolean expression following it.