Original Post
What happen if I have a pointer (b) to a pointer (a) and I delete pointer a and set it to NULL. Is is then possible to check if pointer b exist by asking if it is NULL?
Like this:
class Foo
{
Model* a; // allocate the memory
}
class Window
{
Model* b; // only a pointer
}
void main()
{
Foo kFoo;
kFoo.a = new Model;
Window kWnd;
kWnd.b = kFoo.a;
delete kFoo.a;
kFoo.a = NULL;
if(kWnd.b != NULL)
{
// do something...
}
}