c++ - why cannot redefine a macro with previous value even using a temp variable? -


for example,i have macro string a="a", want append "b" a, become "ab", tried

#define "a" #define a "b" 

and found seems become self referential macros not possible. tried hold value of "b" using temp variable temp first, , undefine , define temp:

#include <sstream> #define "a" #define temp "b" #undef #define temp int main(){     printf(a);     return 0; } 

but still cannot compile, why?


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -