Can we give an array a negative or out of bound index? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Can we give an array a negative or out of bound index?

like : int c[20]; cout<<c[-10]<<c[50];

26th Sep 2017, 10:20 PM
Mohammad Amin Khanpour
2 Respostas
+ 2
Did it work?
26th Sep 2017, 11:05 PM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar
+ 2
Yes you can, though I can't quite explain that wierd output
26th Sep 2017, 11:06 PM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar