Macro in a loop? -


for(x;x<crap;x++) {     macro(x,y); } 

how handled preprocessor? loop unrolled or else?

the macro expanded before code compiled - doesn't matter whether it's in loop or anywhere else.

#define macro(x, y) dosomething(x, y) for(x;x<crap;x++){     macro(x,y); } 

will expand to:

for(x;x<crap;x++){     dosomething(x,y); } 

the context surrounding macro(x,y) has no effect on how preprocessor expands it.

(the preprocessor doesn't know programming language you're using - c, python, brainfuck or letter bank manager , expand macros same way.)


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -