18th Oct 2020, 6:20 AM
Vikramjeet Singh
Vikramjeet Singh - avatar
3 ответов
+ 3
You are passing address of 'a' to fun, which has int* b now pointing to that address. So (*b) will print the value 3. Then you are modifying the value at address a by doing *b = 2. If now you print *b in main then it will return 2. So you have 32 as result.
18th Oct 2020, 7:32 AM
Avinesh
Avinesh - avatar
+ 1
Thankyou so much but last question like *b=&a when we want to change the value in b is it automattically changed in a
18th Oct 2020, 7:51 AM
Vikramjeet Singh
Vikramjeet Singh - avatar
18th Oct 2020, 8:57 AM
Avinesh
Avinesh - avatar