Author
anonymous
over 7 years ago
Language
Compiler
Options
Author
anonymous
over 7 years ago
$
prog.c:6:26: warning: array index -1 is before the beginning of the array [-Warray-bounds]
printf("Nummer -1: %d\n",arr1[-1]); //outputs 0
^ ~~
prog.c:4:9: note: array 'arr1' declared here
int arr1[] = {33, 12, 75, 85, 62, 14, 100, 29};
^
prog.c:7:25: warning: array index 8 is past the end of the array (which contains 8 elements) [-Warray-bounds]
printf("Nummer 8: %d\n",arr1[8]); //outputs 0
^ ~
prog.c:4:9: note: array 'arr1' declared here
int arr1[] = {33, 12, 75, 85, 62, 14, 100, 29};
^
prog.c:10:26: warning: array index -1 is before the beginning of the array [-Warray-bounds]
printf("Nummer -1: %d\n",arr2[-1]); //outputs 29
^ ~~
prog.c:9:1: note: array 'arr2' declared here
int arr2[] = {85, 15, 84, 96, 4, 45, 55, 12, 25, 68};
^
3 warnings generated.
Nummer -1: 0
Nummer 8: 1897372800
Nummer -1: 13
Exit Code:
0