Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6361881
  • 博文数量: 579
  • 博客积分: 1548
  • 博客等级: 上尉
  • 技术积分: 16634
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-12 15:29
个人简介

http://www.csdn.net/ http://www.arm.com/zh/ https://www.kernel.org/ http://www.linuxpk.com/ http://www.51develop.net/ http://linux.chinaitlab.com/ http://www.embeddedlinux.org.cn http://bbs.pediy.com/

文章分类

全部博文(579)

文章存档

2018年(18)

2015年(91)

2014年(159)

2013年(231)

2012年(80)

分类: C/C++

2014-09-03 15:43:20

前言:
    在阅读国外源码的时候,发现很多宏定义中 #define 中有空格(# define),特别是在 #if , #else , #endif 中。

一,测试

点击(此处)折叠或打开

  1. #include <stdio.h>

  2. #define f_str "#define"

  3. # define s_str "# define"



  4. int main(int argv,char *argc[])
  5. {
  6.     printf("%s\n",f_str);
  7.     printf("%s\n",s_str);

  8.     return 0;
  9. }
    测试结果:
    

    结论:
        在 C 语言中,宏定义《#define》 和 宏定义 《# define》 都是可以编译通过的,且功能一样的

    猜测:
        这个可能是为了提高代码的可读性
        
        
阅读(18394) | 评论(0) | 转发(5) |
给主人留下些什么吧!~~