Is it safe to delete a NULL pointer?

前端 未结 7 1413
忘掉有多难
忘掉有多难 2020-11-22 06:51

Is it safe to delete a NULL pointer?

And is it a good coding style?

7条回答
  •  抹茶落季
    2020-11-22 06:55

    It is safe unless you overloaded the delete operator. if you overloaded the delete operator and not handling null condition then it is not safe at all.

提交回复
热议问题