+ 2
What happened at last cout.
I couldn't get the logic why it increment https://code.sololearn.com/cMgSy0xbwORg/?ref=app
2 ответов
+ 3
i[3] is a local array which means that its memory on the stack will be made available for other variables after its scope (the function) ends.
*a is pointing to the memory of i[3] in f(1).
g(2) overwrites the memory *a is pointing to.
Therefore *a is g(2).
I hope this is correct, but it makes sense to me.
0
this seems logical for my program.
thanks
can you see what's in difference there.i just modified this program to check your logic.
https://www.sololearn.com/discuss/1136603/?ref=app