Check for Null Pointer Before Deleting in C/C++



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.

Updated on: 2019-07-30T22:30:26+05:30

466 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements