An empty-hanging pointer is a pointer to a normal initialization of a pointer that once pointed to a normal object, but the object is destroyed, and the pointer is not empty and becomes a dangling pointer.
A wild pointer is a pointer to an uninitialized pointer whose pointer content is a garbage number. (In general, when we define a pointer, it is initialized to null or directly to the address of the variable you want to point to, but if we do not point to null or the variable address is used for the pointer, the memory address pointed to by the pointer is random). The presence of a wild pointer is a serious error.
int main () { int *p;//pointer uninitialized, at which point P is the wild pointer int *pi = nullptr; { int i = 6; PI = &i; At this point the pi points to a normal address *pi = 8;//OK } *pi = 6;//Because the PI pointer to the variable i has been destroyed, the PI is now a dangling pointer return 0;
Wild pointer dangling pointer and dangling reference