That's a compiler dependent problem now.
Previously, any declaration of a local array had to be done with a constant expression as the size. The latest C standard (C99) has changed that restriction, but not all compilers have adopted that. And remember, the C++ standard includes the C standard, more or less.
So, legally speaking:
int size = 5;
int arr[size];
is now a legitimate construct. Current version of gcc supports this. Visual C++ does not.
Now I have to go change my lesson plans.....
Val