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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -