A null pointer means that the pointer does not point to anything, or in some languages ββit means that it is not known what it points to. But since this is a null pointer, you know this, the code knows about this, so there is no problem. A dangling pointer is one that, in your opinion, points to something, but in fact it is no longer there, so the pointer is actually inaccurate, but does not know it.
source share