宏定义转字符串#a
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <limits.h>
#include <stdio.h>
#define CONFIG_DIR "/etc/usbs/"
struct macro {
const char *name;
unsigned int code;
};
#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
#define URB_FUNCTION_SELECT_INTERFACE 0x0001
#define K_V(a) {#a, a},
#define K_V1(a) #a
int main()
{
printf("%s",K_V1(URB_FUNCTION_SELECT_INTERFACE));
return 0;
}
输出: URB_FUNCTION_SELECT_INTERFACE
浙公网安备 33010602011771号