0

Was wondering about Null pointers , do they really point to location zero in memory and does that location got all the bits zero. Does this mean a NULL pointer points to itself?

Node<Type> *A = 0;
A = Find_Node(Position-1)->R_Link;

I have this code , where "Find_Node" function returns a pointer to a class "Node" , sometimes the function will return a null pointer , will this store 0 in A ?
i m guessing arrow operator won't handle it and will give an error.

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by samtan
0

The null pointer constant (NULL) is guaranteed (by the compiler) not to point to any real object. It never points to "location zero in memory". Likewise the constant NULL is guaranteed to be 0.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.