Why doesnt -1 work for the array? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Why doesnt -1 work for the array?

I'm trying to use arr[-1] to access the last element of the array.

5th Apr 2019, 10:50 PM
gemon abraham
gemon abraham - avatar
4 Antworten
+ 9
Help us to help you: What language are you using ? If you are working on a code, save it in the code playground and post it here.
5th Apr 2019, 11:01 PM
Cépagrave
Cépagrave - avatar
+ 8
You can save the code you tried to modify, and post it here.
5th Apr 2019, 11:05 PM
Cépagrave
Cépagrave - avatar
+ 7
I guess you learned python first😂 Only python get items with negative index😂
7th Apr 2019, 8:29 AM
Flandre Scarlet
Flandre Scarlet - avatar
0
I was doing the c++ course and im working on one of the practice questions
5th Apr 2019, 11:02 PM
gemon abraham
gemon abraham - avatar