+ 1

Result 0 in pointer?

Code sample: https://code.sololearn.com/cxbA0y857Ozf Please tell me why its showing up 0 there.

19th Jul 2019, 11:47 AM
N1H4R
N1H4R - avatar
1 Resposta
0
Its result is actually undefined behaviour, when it executes x++; ++x; the increment actually increment the value of x, which was the address of y. After that, *x is not the value of y anymore, but some undefined value
19th Jul 2019, 12:42 PM
Agent_I
Agent_I - avatar