问题描述
请告诉我一个空指针&放大器之间的差异;一个空指针
Whats the difference between a Null pointer & a Void pointer?
推荐答案
的空指针的是一个特殊的保留的指针的值。任何类型的指针有这样的保留价值。从形式上看,每一个具体的指针类型(为int *
,的char *
等)都有自己专用的空指针值。从概念上讲,当指针有它不指向任何地方的空值。
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. That essentially means that your question, as stated, is not exactly valid. It is like asking, for example, "What is the difference between a triangle and a car?".
这篇关于什么是空指针和一个空指针之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!