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

differences between null pointer and void pointer.

时间:2014-09-16 06:00:20      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:io   ar   strong   for   sp   on   c   r   res   

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.

differences between null pointer and void pointer.

标签:io   ar   strong   for   sp   on   c   r   res   

原文地址:http://www.cnblogs.com/miaoz/p/3974105.html

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