Just curious, what actually happens if I define a zero-length array int array[0]; in code? GCC doesn\'t complain at all.
int array[0];
Sample Program
In Standard C and C++, zero-size array is not allowed..
If you're using GCC, compile it with -pedantic option. It will give warning, saying:
-pedantic
zero.c:3:6: warning: ISO C forbids zero-size array 'a' [-pedantic]
In case of C++, it gives similar warning.