C
x
1
2
int main(void)
3
{
4
int array[]={10,5}; /* 必要最小限の文字数で解答 */
5
printf("%d\n", array[0]);
6
printf("%d\n", array[1]);
7
printf("%d\n", array[2]);
8
return 0;
9
}
$ gcc prog.c -Wall -Wextra -O2 -march=native -std=c89 -pedantic
Start
prog.c: In function 'main': prog.c:7:5: warning: array subscript 2 is above array bounds of 'int[2]' [-Warray-bounds] 7 | printf("%d\n", array[2]); | ^~~~~~~~~~~~~~~~~~~~~~~~ prog.c:4:9: note: while referencing 'array' 4 | int array[]={10,5}; /* 必要最小限の文字数で解答 */ | ^~~~~
10 5 0
0
Finish