预处理运算符
The # is a preprocessor operator, which is used to convert an argument into string i.e. quoted string.
#是预处理程序运算符,用于将参数转换为字符串,即带引号的字符串。
Example:
例:
#include <stdio.h>
#define STR(X) #X
int main(){
printf("%s\n",STR(Hello world!));
printf("%s\n",STR(How are you?));
printf("%s\n",STR(I love programming!));
return 0;
}
Output
输出量
Hello world!
How are you?
I love programming!
翻译自: https://www.includehelp.com/c-programs/hash-preprocessor-operator-example.aspx
预处理运算符