Is there a way to find whether a pointer is assigned a value or not?
Is there a way to find whether a pointer is assigned a value or not?
If you set pointers to 0 (or null, pretty much same thing in C++) when they no longer point to anything, you can just check if it is a null pointer. Other than that no, I do not think you can properly determine if a pointer points to a valid object or not.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)