Message from C, C++ talks

July 2019

— B is destroyed and a will never be changed to b's value

— Yes b is destroyed. but what matters is the address that is still valid because the heap has not released the memory

Message permanent page

— But you didn't save this address

— Right

— 

Do I really need to? If I know the address(which is same throughout the program) why is there a need to save it

— Wtf

— A needs to know the address, not you

— Wtf. Right after the call you lost this address. You don't know it. It's gone

— Of cors, a has the address (which is same throughout the program).
I am sorry if I am not able to explain my point well

Message permanent page

— But if it doesn't work....

— You can't get it outside, cause only b holds it

— And b is gone

— Wait...I will gdb and double check the addresses pointed to by a before foo and after foo.

— If they are same, my point stand valid..right?

— No