I've two functions:
void foo0(int bar);
void foo1(int bar);
I wan't to be able create a macro QUX
that will expand to these function names based on another macro BAZ
. I tried the following:
#define BAZ 0
#define QUX(x) foo##BAZ(x)
But it did not work since the generated function was fooBAZ()
. How can I get it to generate foo0()
?
#define CAT_I(a,b) a##b
#define CAT(a,b) CAT_I(a, b)
#define QUX(x) CAT(foo, BAZ) ## (x)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With