Top
/
C++
/
Memory
/
Dangling pointers
/
Answer-dangling-5
Answer to Question dangling-5
Variable
p
is not assigned any value. It starts out as a dangling pointer. Statement
*p = 50;
tries to store 50 at whatever memory address is in variable
p
. The consequences of that can vary from none to catastrophic.