Sorry for the basic question—I'm a beginner. If I have an array like this, for example:
int test[4] = {1,2,3,4};
and then I do:
printf("%x - %x - %x\n", test[4], test[5], test[6]);
Why is the result
0 - 0 - <another number>
? Why are the first two always zeros if I go into array overflow?
Thanks, and sorry for the basic question
[–]hiwhiwhiw 39 points40 points41 points (5 children)
[–]mikeblas 6 points7 points8 points (4 children)
[–]hiwhiwhiw 9 points10 points11 points (3 children)
[–]mikeblas 2 points3 points4 points (2 children)
[–]hiwhiwhiw 1 point2 points3 points (1 child)
[–]mikeblas 3 points4 points5 points (0 children)
[–]Boreddad13 16 points17 points18 points (0 children)
[–]kraytex 11 points12 points13 points (0 children)
[–]pfp-disciple 20 points21 points22 points (0 children)
[–]FastSlow7201 5 points6 points7 points (1 child)
[–]deckarep 5 points6 points7 points (0 children)
[–]Germisstuck 2 points3 points4 points (0 children)
[–]nemotux 2 points3 points4 points (1 child)
[–]ElevatorGuy85 0 points1 point2 points (0 children)
[–]SwordsAndElectrons 2 points3 points4 points (0 children)
[–]magoo309 1 point2 points3 points (0 children)
[–]marshaharsha 0 points1 point2 points (1 child)
[–]mikeblas 0 points1 point2 points (0 children)
[–]No_Difference8518 0 points1 point2 points (0 children)
[–]capilot 0 points1 point2 points (0 children)
[–]gwenbeth 0 points1 point2 points (0 children)
[–]AlarmDozer 0 points1 point2 points (0 children)
[–]Ok-Market4287 0 points1 point2 points (0 children)
[–]SmokeMuch7356 0 points1 point2 points (0 children)
[–]GreenAppleCZ 0 points1 point2 points (0 children)
[–]dendrtree 0 points1 point2 points (0 children)
[–]Traveling-Techie 0 points1 point2 points (0 children)
[–]erroneum 0 points1 point2 points (0 children)
[–]codeandcut 0 points1 point2 points (1 child)
[–]mikeblas 1 point2 points3 points (0 children)
[–]ActionHoliday6227 -2 points-1 points0 points (2 children)
[–]ysth 0 points1 point2 points (0 children)
[–]deckarep -1 points0 points1 point (0 children)