differences between null pointer and void pointer.

These are two different concepts, you cannot compare them. What the difference between the skunk and the moonlight?

Null pointer is a special reserved value of a pointer. A pointer of any type has such a reserved value. Formally, each specific pointer type (int *, char * etc.) has its own dedicated null-pointer value. Conceptually, when a pointer has that null value it is not pointing anywhere.

Void pointer is a specific pointer type - void * - a pointer that points to some data location in storage, which doesn't have any specific type.

So, once again, null pointer is a value, while void pointer is a type. These concepts are totally different and non-comparable.

posted @ 2014-09-16 05:28  zmiao  阅读(180)  评论(0编辑  收藏  举报