码迷,mamicode.com
首页 > 其他好文 > 详细

NULL 和 0

时间:2017-05-03 13:03:35      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:border   over   rac   tom   mono   cannot   sign   rom   stream   

Question:

What is the difference from NULL and "0"?

Example:

return NULL;
return 0;
Answer:

Conceptually, zero (0) is a number, and NULL is a value that represents "no value". As such, 0 can be added, subtracted, etc., but NULL cannot. The NULL value for a variable can indicate, for example, that a variable has not yet been assigned a value.

The semantics of NULL may vary by language or application.

NULL 和 0

标签:border   over   rac   tom   mono   cannot   sign   rom   stream   

原文地址:http://www.cnblogs.com/slgkaifa/p/6801092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!