Why does not this code compile with VC++ 15 in visual studio 2008?
Because C-style variable length arrays are not part of the C++ language. GCC provides them as a non-standard extension; some compilers don't.
I need compatibility between compilers.
Then you'll need a dynamic array, for example:
std::vector< std::vector<double> > arr(a, std::vector<double>(b));
or, if you want all the elements to be contiguous as they would be in a 2-dimensional array:
std::vector<double> arr(a*b);
with appropriate arithmetic to calculate the indexes when you access it.