when you have [] on array declaration means that the array size is chosen by the compiler depending on the elements given.
An array is useful just for simple stuff
Well, the above code is stupid. The size is omitted usually so that the programmer doesn't have to count the elements, since the compiler is pretty good at counting.
But line 2 should read
int array_size = sizeof(array) / sizeof( array[0] );
Or better yet
1 2 3 4 5 6
template< typename T, size_t N >
size_t ArraySize( T (&)[ N ] )
{ return N; }
//...
int array_size = ArraySize( array );