-
delete []
Will an error ocure if I use delete [] var and the var pointer isn't pointing at anything. This could happen if you have an if statement and only if this is correct var will be set to point at whatever. But if it's not correct then it wont point at **** and you will delete an adress that doesn't exist. Is this a problem.
If it is I'll move the delete [] into the end of the if statement.
-
As far as I know, you can call delete/delete[] on a NULL pointer without problems, but if you call it on a memory address that doesnt hold memory allocated by new/new[] then the outcome is undefined....most likely it will crash
-
I think it will delete whats at that given addres and then if you have to use that variable you're... YES! :p