0 is an integer constant,

'\0' is a character constant,

nul is the name of the character constant.

NULL is a macro defined in several standard headers,

All of these are *not* interchangeable:

NULL is to be used for pointers only since it may be defined as ((void *)0), this would cause problems with anything but pointers.

0 can be used anywhere, it is the generic symbol for each type's zero value and the compiler will sort things out.

'\0' should be used only in a character context.

nul is not defined in C or C++, it shouldn't be used unless you define it yourself in a suitable manner, like:

#define nul '\0'

EOF :通常定义为-1, 文件结束符标志,一般是ctrl+z.

关于EOF的详细介绍可以参考http://www.ruanyifeng.com/blog/2011/11/eof.html

NULL、NUL、‘\0’、0以及EOF的更多相关文章

  1. NULL, NUL, EOF, '\0',0区别

    NULL: 定义为0或0L或(void *)0,用于指示一个指针值是空,即什么都不指:'\0': 用且只用字符串结束符;NUL : 0x00,0值字符,可以用于结束ASCII字符串,和'\0'类似,但 ...

  2. '0','\0',NULL,EOF的区别

    要看是不是一个东西,打印一下即可 printf("%d %d %d %d\n",'0','\0',NULL,EOF); 输出: 48 0 0 -1 结论: '\0'与NULL 都是 ...

  3. Type 'Insus.NET.PictureObject' in Assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

    昨晚想实现一个功能,需要把一个对象存储于ViewState中去,但在运行时,出现下面的异常. Type 'Insus.NET.PictureObject' in Assembly 'App_Code, ...

  4. System.BadImageFormatException : 未能加载文件或程序集“Medici.PaymentRecover, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。试图加载格式不正确的程序。

    System.BadImageFormatException : 未能加载文件或程序集“xxxxx.xxxxx, Version=1.0.0.0, Culture=neutral, PublicKey ...

  5. mysql 将null转代为0

    mysql 将null转代为0 分类: Mysql2012-12-15 11:56 6447人阅读 评论(1) 收藏 举报 1.如果为空返回0 select ifnull(null,0) 2.如果为空 ...

  6. 已经导入了具有相同的简单名称“Interop.DSOFramer, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null”的程序集。

    错误  : 已经导入了具有相同的简单名称“Interop.DSOFramer, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null”的程序集. ...

  7. NULL, '\0',0 '0'的区别

    如题,在程序中经常遇到NULL,和'\0',常常疑惑它们是什么关系,其实它们的值是一样的,只不过表现的形式不一样: 1.NULL; NULL 即空指针,在C和C++中的形式不一样,msdn上有如下的内 ...

  8. 未能加载文件或程序集“**, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。试图加载格式不正确的程序。

    未能加载文件或程序集“Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项.试图加载格式不正确的程序. 原来, ...

  9. 未能加载或程序集“XXXX,Version=0.0.0.0,Culter=neutral,PublicKeyToken=null”或它的某一个依赖项。试图加载格式不正确的程序。

    问题描述:在VS中运行一个C#程序,出现错误: 未能加载或程序集“XXXX,Version=0.0.0.0,Culter=neutral,PublicKeyToken=null”或它的某一个依赖项.试 ...

  10. Javascript中的undefined、null、""、0值和false的区别总结

    在程序语言中定义的各种各样的数据类型中,我们都会为其定义一个"空值"或"假值",比如对象类型的空值null,.NET Framework中数据库字段的空值DBN ...

随机推荐

  1. 关于VBox安装GhostXP出现蓝屏processr.sys 的解决办法

    用VirtualBox虚拟系统安装了一个Ghost XP SP3,还原系统后,重启进入Windows XP时,出现蓝屏提示processr.sys, 蓝屏代码为0x000000CE提示处理器驱动文件问 ...

  2. hdu1753I Hate It(线段树)

    http://acm.hdu.edu.cn/showproblem.php?pid=1754 单点更新,区间求最值 // File Name: hdu1754.cpp // Author: bo_jw ...

  3. c++中指针类型在c#中怎么对应?

    int[] a=new int[5]; //取a[3]的地址 IntPtr addr=System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinned ...

  4. 编译安装-MySQL5.5

    一.参数选项 1.目录选项 2.存储引擎选项 3.库文件加载选项 二.安装 1.环境准备 2.安装前的系统设置 3.安装执行 4.初始化数据库 5.注册为服务 6.加入环境变量 7.启动服务 8.重新 ...

  5. 浅谈iOS IPv6-only 新规

    5月份苹果发布新规,对于开发人员只需要做到以下几点就能顺利上线啦! 1.苹果从6月1日起,提供App Store审核的应用必须要兼容面向硬件识别和网络路由的最新互联网协议--IPv6-only标准.也 ...

  6. 利用HTML5开发Android(5)---HTML5地理位置服务在Android中的应用

    Android中 Java代码 //启用地理定位 webSettings.setGeolocationEnabled(true); //设置定位的数据库路径 webSettings.setGeoloc ...

  7. inpuy type=date

    http://www.w3schools.com/html/html_form_input_types.asp http://caniuse.com/#feat=input-datetime 浏览器兼 ...

  8. baseDao 使用spring3+hibernate3方式

    package cn.zk.pic.service.dao; import java.io.Serializable; import java.util.List; import java.util. ...

  9. 【转】 解决IllegalStateException: Can not perform this action after onSaveInstanceState

    今天使用Fragment的时候,出现了这个错误 IllegalStateException: Can not perform this action after onSaveInstanceState ...

  10. Flex编程注意之直接获取某个组件的对象(this[]用法)通过id获取控件

    有这样一个需求:假如你new了一百次Button,同时这些button的id分别赋值如btn1.id = "button1"; btn2.id = "button2&qu ...