NULL 和 0
Posted slgkaifa
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NULL 和 0相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章