【发布时间】:2010-10-18 15:59:30
【问题描述】:
下面的程序在 Windows 上运行良好。但是在linux上出现编译错误 “错误:粘贴“.”和“config”没有给出有效的预处理令牌”
有什么理由???我不明白为什么....
#include <stdio.h>
typedef struct pr {
int config;
}pr_t;
#define JOIN(x,y) x.##y
void main()
{
pr_t temp = {5};
printf("Value %d\n", JOIN(temp, config)); //temp.config
return 0;
}
【问题讨论】:
-
您是从哪里想到要为该功能使用预处理器粘贴的?
标签: c