Yes, that's how we dereferenc pointer. Dereferencing them, yields tha
actual data they point to.
Generally, NULL is considered to be a error condition. Like the
pointer is not pointing anywhere.
To declare NULL pointer use,
int * intPtr = (int *) NULL; /* NULL is defined as 0 */
Dereferncing NULL pointer may cause illegal operation...I am not sure
sumit
Please do not top post. I actually thought that Jun's post was a
correct answer. Your post has some odd constructions. For example,
you do not need to cast NULL explicitly.
NULL is a macro defined in stddef.h. to be the null pointer constant.
A null pointer constant is an integer constant expression with the
value 0 or such an expression casted to void*. A null pointer
constant converted to a pointer type is called a null pointer.
#include <stddef.h>
int* ip = NULL;
*ip; // undefined behavior
would be sufficient. The problem with derefencing a null pointer is
that it invokes undefined behavior. It is impossible to know how any
particular implementation will handle it.
Best wishes,
Bob