B
borophyll
Hi all
Can anyone explain to me the algorithm for macro expansion in the C++
preprocessor. I am confused why the following code works like it
does:
#define A(x) #x
#define B(x) A(x)
#define TEST 1
A(TEST)
B(TEST)
When I run the preprocessor, It gives me "TEST" and "1". Can anyone
explain? I thought they would be the same....
regards, B
Can anyone explain to me the algorithm for macro expansion in the C++
preprocessor. I am confused why the following code works like it
does:
#define A(x) #x
#define B(x) A(x)
#define TEST 1
A(TEST)
B(TEST)
When I run the preprocessor, It gives me "TEST" and "1". Can anyone
explain? I thought they would be the same....
regards, B