a lot thanks for your explanation . I really appreciate your answer.
earlier x
was pointing to the address where v
was stored but now i realize that this statement (x=new int;
) will make x
pointing to another location . therefore the statement(*x=12
) will not write at the location where v
is stored because x
is now no longer pointing to v
[because of this(x=new int
)].
once again thanks.