Home > Backend Development > C++ > body text

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

WBOY
Release: 2023-08-25 16:37:11
forward
882 people have browsed it

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

Checking a NULL pointer before deleting is basically pointless. If the pointer is set to NULL, deleting the pointer does nothing. This may be a reason for checking for NULL pointers, and deleting a pointer that has been set to NULL may indicate a bug in the program.

The above is the detailed content of Why check for NULL pointer before deleting in C/C++?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template