Is there a way to find whether a pointer is assigned a value or not?
This is a discussion on Pointers within the C++ Programming forums, part of the General Programming Boards category; 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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way