取得宏展开#define TO_STRING( x ) TO_STRING1( x ) #define TO_STRING1( x ) #x

#define TO_STRING( x ) TO_STRING1( x )
   #define TO_STRING1( x ) #x
   TO_STRING首先会将x全部展开(如果x也是一个宏的话),然后再传给TO_STRING1转换为字符串,现在你可以这样:
   const char *str = TO_STRING( PARAM( ADDPARAM( 1 ) ) );去一探PARAM展开后的样子

你可能感兴趣的:(取得宏展开#define TO_STRING( x ) TO_STRING1( x ) #define TO_STRING1( x ) #x)