I'm using GCC 4.6.3
And it compiles with it :(
Demand conformance with the standard, and gcc would generate an error.
> g++ -std=c89 -pedantic-errors -c my_ill_formed_program.c
Change int i[0] to int i[1] and the code will work :)
1 2 3 4 5 6 7 8 9
|
#include <stdio.h>
int main(void)
{
int i[1];
i[0]=9;
printf("%i\n", i[0]);
return 0;
}
| |
Last edited on