C语言:运行中获取宏名字的技巧
在调试C语言程序时,有时需要打印宏的名字。可以通过定义宏,宏名字的数组来获得。例如:#include<stdio.h> #defineMACRO_STR(x){x,#x} typedefstruct_macro_str{intid;char*name;}MACRO_STR_T;typedefenum_color{RED,GREEN,BLUE,}COLOR;MACRO_STR_Tg_color_str[]={MACRO_STR(RED),MACR...