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,438
  • 68
  • 55
  • 126
Matteo Monti
  • 7,566
  • 17
  • 58
  • 107

0 Answers0