c++11 - C++ else statement only if Macro is define -


i'm trying if/else statement. want wrap else statement in #ifdef macro test.

if (check1) { ... } #ifdef macro else  {...} #endif 

is allowed?

the preprocessor runs before compiler. if preprocessor evaluates macro , generates valid c/c++ code (like example you've included), it's valid usage.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -