+ 5
Why does this compile and why is the answer zero?
8 Answers
+ 6
Federico đș thanks for the links.
+ 6
Federico đș in real life I would have never written such code if not for a challenge question I encountered here? See below.
https://www.sololearn.com/post/179198/?ref=app
+ 4
I'm especially surprised that line 6 does not cause an error.
+ 1
My guess is that itâs probably getting 0 as the value of whatever was stored in the memory address located just before the array. C++ doesnât seem to care about where its arrays are being indexed at lol
- 1
Becuz you can't put -1