Nice but it doesn't always work.
I got my compiler fail a few times if the array is defined outside main.
Instead i had to use vector or alloc()
Code:
int array = new int[10];
// but can't resize it now
array = new int[100]; // error
Code:
array = (int *)malloc(10 * sizeof(int *));
array = (int *)realloc(array, 100 * sizeof(int *));