Array Question

19 hours ago 13

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

submitted by /u/sl0th-ctrl-z to r/C_Programming
[link] [comments]
Read Entire Article