+ 10
Why the value of a is equal to 10?
Even the "a" is not modified why the value is changed. https://code.sololearn.com/c66s2Mt7he9P/?ref=app
3 Answers
+ 6
b is an array of 2 elements, but b[3] = 10 changes memory outside of its index range, resulting in undefined behavior. Here, the memory space of b[3] is the same as the variable a.
+ 5
It was discussed here https://www.sololearn.com/Discuss/1665350/?ref=app
+ 1
a[3]=10