+ 5

arrays

what will be the output? arr []={1,2,3} cout <<arr [3]:

27th Aug 2016, 4:42 PM
Piyush Yadav
Piyush Yadav - avatar
5 Réponses
+ 2
suppose this won't run
27th Aug 2016, 4:43 PM
Piyush Yadav
Piyush Yadav - avatar
+ 2
This will print the content of the memory near the array as an int, or in other words, garbage.
27th Aug 2016, 10:39 PM
Zen
Zen - avatar
+ 1
error coz u specified 3 elements and u wanted output for number 3 i.e number 4 in arrays which isnt thr so i think either it will show an error or just outputs nothing
27th Aug 2016, 4:51 PM
Suhail Pappu
Suhail Pappu - avatar
+ 1
no output.
27th Aug 2016, 7:53 PM
Andres Melo
Andres Melo - avatar
+ 1
because array count index begin at 0 this should lead to a error or will show a garbage value
28th Aug 2016, 6:32 PM
Carlos Augusto Silva Gurgel
Carlos Augusto Silva Gurgel - avatar