2

Consider the following:

#define asd(a, b) a ## _ ## b
#define concat(a, b) a ## b

When I do:

concat(__, asd(x, y));

I would expect to get

__x_y

But no, the asd part is not evaluated as a macro. What am I supposed to do? I also tried directly with

__ ## asd(x, y)

But no, that doesn't work either. Is there any way to get what I need, i.e., the result of asd(x, y) to be used in concat instead of the explicit "asd(x, y)" expression?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Matteo Monti
  • 8,362
  • 19
  • 68
  • 114

0 Answers0