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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -