c - Use name of #define parameter without stringification -
is there way exact words passed #define
without stringifying? example use case:
#define num 1 #define create_fun(x) \ void prefix_x() { \ // used exact words passed in int x = x; \ // use value later on } create_fun(num)
and output like:
void prefix_num() { int x = 1; }
use token concatenation (##
):
#define num 1 #define create_fun(x) \ void prefix_##x() { \ int x = x; \ } create_fun(num)
Comments
Post a Comment