Why do we check for a NULL pointer before deleting in C/C++?

CC++Server Side ProgrammingProgramming

It is basically pointless to check for a NULL pointer before deleting. Deleting a pointer will do nothing if the pointer set to NULL. It might be the reason to check for the NULL pointer that deleting a pointer which is already set to NULL may indicate bugs in the program.

raja
Published on 18-Jun-2019 12:31:11
Advertisements