+ 1
How can I catch Null Referencee Pointer exception
I want m'y pointer to be read only if he has a value
1 Answer
+ 1
You should set all of your pointers to nullptr when being deleted or allocated, so then you can just ask:
if (pointer==nullptr) throw -1;