User account creation filtered due to spam.
int svar = 13;
ptr = &svar;
int mvar = 144;
output is 13 but if i add this line (after or before printf)
int* p = &mvar;
output is 144.
svar leaves the scope so the address of it becomes invalid. Any access to that address is undefined.