Summarizing the C standard, specifically ISO/IEC 9899:201x §6.3.2.3 - 3:
If a pointer is being compared to the constant literal 0
, then this is a check to see if the pointer is a null pointer. This 0
is then referred to as a null pointer constant. The C standard defines that 0
cast to the type void *
is both a null pointer and a null pointer constant.
Now if we look at (void *)0
it is an address(illegal in this context) that is pointing to void
.
Normally we can cast such an address to any appropriate pointer datatype and dereference it but here even after casting it to some other pointer type it is illegal to dereference it.
So my doubt is:
Can we call (void *)0
as a void pointer looking the way it is defined?
Also see the below code:
void *pointer = NULL;
What will I call it now? A void pointer, a null pointer or a null void pointer?