|
|
|
|
|
by akhosravian
1189 days ago
|
|
FWIW the behavior of delete on a pointer that isn’t either null or returned from new is undefined. So a conforming C++ compiler doesn’t have to diagnose this mistake, and similarly the compiled program doesn’t have to do anything meaningful either. For example, just ignoring the delete and printing the message is as valid a result as the more useful crash at the site of the bad operation. |
|