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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -