I have never worked with #if, #ifdef, #ifndef, #else, #elif and #endif
The example you showed doesn't seem helpful due to lack of other information. But here's an example that #if
is useful.
#if OS == LINUX
//do something
#elif OS == SOLARIS
//do something else
#else
//
#endif
The key is that #if
is evaluated in compile time, but if
is evaluated when program runs.
#if BYTE_ORDER == LITTLE_ENDIAN
//do something
#else
//do something else
#endif