C语言#define STR3 STR STR1 STR2的理解

来源:互联网 发布:自考,成考,远程网络 编辑:程序博客网 时间:2024/06/06 13:08



首先写代码测试:
#include<stdio.h>
#define STR "this is"
#define STR1 "a test"
#define STR2 "example"
#define STR3 STR STR1 STR2 
int main(void)
{
 printf(STR3); 
 return 0;
}


输出结果:
this isa testexample


总结:#define STR3 STR STR1 STR2
#define 只将第一个“空格”作为分割,后面的连在一起并且是忽略空格的
0 0
原创粉丝点击