C语言宏定义的##使用问题
今天学习宏定义,使用##时遇见了下面的问题
#include<stdio.h>#include<string.h>#define PI 3.14#define AREA(R) PI*(R)*(R)#define T(sth) #sth#define STR(X) love##Xint main(int argc,char **argv){ printf("PI=%f\n",PI); printf("area=%f\n",AREA(10)); printf("TTTT=%s\n",T(NIHAO));// char *love=STR(111); char *love; strcpy(love,STR(111)); printf("STR=%s\n",love); return 0;}[root@bogon c_study]# gcc -o hong宏 -g hong宏.c hong宏.c: In function ‘main’:hong宏.c:22: error: ‘love111’ undeclared (first use in this function)hong宏.c:22: error: (Each undeclared identifier is reported only oncehong宏.c:22: error: for each function it appears in.)