c - Macro scope guards -


possible duplicates:
why there meaningless do/while , if/else statements in c/c++ macros?
what's use of while(0) when define macro?

is there difference between

#define macro(x)  \     {             \     ...           \     }          

and

#define macro(x)   \     {           \     ...            \     } while(0)         

?

do { ... } while(0) allows macro used in conditional code.

looks question has been asked before: c multi-line macro: do/while(0) vs scope block

here's link couple of reasons so, , why omit semicolon @ end.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -