Hi, I want to understand why I get a runtime error with these lines: I try to delete a pointer that was never allocated somewhere (don't ask me why...) but I get an error telling me that the pointer is used without being defined...
But then is there a way to check if a pointer allocated with NEW points somewhere or not?Code:int *a; delete a; a = new int;
I tried using this, but still it says that the variable is used without being defined...
Code:if (a != NULL) delete a;