It tries to allocate it, but it does so on the stack, which is usually limited to a few kilobytes of memory. There is not enough stack space for an array that large. You are running into a stack overflow that causes a crash.
You need to allocate from heap memory, which is why you should use std::vector<float> to wrap the allocation, and to automatically free the memory via destructor when the vector goes out of scope.