# 在宏定义中的使用

版权声明:本文为博主原创文章,未经博主允许不得转载。。。。没有所谓的原创,只是总结而已 https://blog.csdn.net/W__L__/article/details/78318802

如需更好的展示博客内容,请点我!

‘#’运算符在宏定义中的使用

#其作用等同于双引号”“,不过只能在宏定义中使用

/*************************************************************************
    > File Name: #.c
    > Author: Z.J
    > Mail: [email protected] 
    > Created Time: 2017年10月22日 星期日 22时43分33秒
 ************************************************************************/

#include<stdio.h>

#define CONVERS(x) #x

int main(void)
{
    char *p = "name is zqw!";
    printf("%s\n",CONVERS(*p));
    printf("%s\n",CONVERS(Hello Word!));
    printf("%s\n",CONVERS(while));
    printf("%s\n",CONVERS(while(1)));
    printf("%s\n",CONVERS(return));
    return 0;
}

// 运行结果
*p
Hello Word!
while
while(1)
return

猜你喜欢

转载自blog.csdn.net/W__L__/article/details/78318802