宏定义转字符串#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

posted on 2021-01-02 17:07  lydstory  阅读(405)  评论(0)    收藏  举报

导航