As other answers indicate, the code is illegal in C in that context.
However, if the declaration includes initialization, then the array has proper size:
int array[] = {10, 20, 30}; // array has size 3
A special case is when the initialization is empty:
int array[] = {}; // array has size 0
In this case, the size of the array is 0. This is not allowed in C, but some compilers support this.
int main()
{
int array[] = {};
printf("%zu", sizeof(array));
}
Compiled by gcc
: OK, prints 0
Compiled by gcc -pedantic
: error: zero or negative size array
Compiled by MS Visual Studio: error: cannot allocate an array of constant size 0
A zero-size array is mostly useless; it provides the same functionality as flexible array member, but is non-standard — only supported for compatibility with some old code.