Whats the difference between a Null pointer & a Void pointer?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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?”.