#define varname(x) #x // 获取变量名
#define SET_NAME(type, name) type name##_##type##_type // ##连接符
typdef strcut
{
int x;
int y;
} t_x_y;
offsetof(t_x_y, y); // 获取y的偏移地址
c 宏的一些使用
最新推荐文章于 2024-07-17 08:30:00 发布
#define varname(x) #x // 获取变量名
#define SET_NAME(type, name) type name##_##type##_type // ##连接符
typdef strcut
{
int x;
int y;
} t_x_y;
offsetof(t_x_y, y); // 获取y的偏移地址