C语言库函数的源代码,是C语言学习参考的好文档。

源代码在线查看: nul!null.txt

软件大小: 905 K
上传用户: yyyz
关键词: C语言 库函数 源代码 文档
下载地址: 免注册下载 普通下载 VIP

相关代码

				+++Date last modified: 05-Jul-1997
				
				Q: My compiler gives me a warning whenever I try to assign or compare the
				   value of NULL to an integral type (char, short, int, long). What's the
				   matter?
				
				
				A: According to the standard, NULL is a macro defined as a null pointer
				   constant so you should expect warnings (at least!) when trying to assign a
				   pointer to an integral type without a (highly questionable) cast!
				
				   This is a fairly common error since people hear other programmers talking
				   all the time about "a null character". As it turns out, ASCII shorthand
				   notation for '\0' happens to be NUL, hence the confusion. In SNIPPETS, I
				   explicitly work around this common error (in SNIPTYPE.H) with the line...
				
				   #define NUL '\0'
				
				   The moral of this story is to know the difference between ASCII NUL and C
				   NULL, and use whichever is correct for your application. In many cases,
				   the correct "null" may be NUL, not NULL.
				
				   Is this confusing enough? ;-) 
							

相关资源