#和##在平时开发的情况下用不到,它大多数在驱动和内核开发用的比较多。那它如何 使用呢?举个例子说明一下:
# 表示字符串化 |
## 表示连接符号 |
#define N(x) #x 相当于“x”
#define N(x) name##x 相当于 namex
1.实战编写一个字符串化例子
#include <stdio.h> |
编译并输出结果 strom@strom-PC:~/Downloads/linux_system/Learn/e/1$ gcc -o build5 welcome8.c |
2.实战编写一个链接符号例子
#include <stdio.h> |
查看输出结果 strom@strom-PC:~/Downloads/linux_system/Learn/e/1$ gcc -o build6 welcome9.c |