The dangling pointer ERROR is an error in which we try to dereference to a memory place which has not been allocated yet.
*x=3; DANGLING POINTER ERROR
After execution of statement 1, in the memory map x can be described as follow:
As till now we have allocated no pointee to the pointer and still we are try to dereference. As there is a random address stored in the pointer, hence if we dereference it now then we may dereference a wrong memory and hence may even corrupt some crucial application.
How ever if we only try to print the value *x then there are no chances of corrupting any application and hence it would not cause much harm but still an erroneous output. It is also called bad pointer bug.