小编y30*_*y30的帖子

使用C宏将字符串转换为非字符串

我知道可以将像这样的东西转换成字符串:

#define STRING(s) #s

printf("%s", STRING(i am string));
Run Code Online (Sandbox Code Playgroud)

但有可能做相反的事情吗?

#define MyType(type) ??? 

MyType("uint16_t") myint = 100;
Run Code Online (Sandbox Code Playgroud)

c c++ c-preprocessor

6
推荐指数
1
解决办法
306
查看次数

标签 统计

c ×1

c++ ×1

c-preprocessor ×1