That's because in many cases (not all) the vector allocates on the heap.
activecat wrote:
If I change it to float XX[dimension];
This is not standard C++, you must specify array size from a constant. In other words, for your test to be valid, your arrays must be allocated on the heap as well.