+ 5
Why does this compile and why is the answer zero?
8 odpowiedzi
+ 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