开发者

Confusing Nulls in c [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Please explain following things in regard of C or C++:

  • The null pointer

  • The internal representation of a null pointer

  • The null pointer constant - 0

  • The NULL macro

  • The ASCII null character (NUL)

  • The null string ("").

  • 开发者_开发技巧


The null pointer is a pointer that doesn't point to any object.

The internal representation is not specified, and specifically doesn't have to be all bits zero.

The value 0 can be converted to a null pointer.

The NULL macro is defined as a value that can be converted to a null pointer, in C++ it is often just 0 and in C often (void*)0, but can be other values as well if the implementation decides so.

The NUL character is a character that has the value 0 or '\0'.

The string "" is just an empty string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜