There are basically two ways you can allocate the matrices, the most common is to use a pointer-to-pointer-to-float, and then allocate first the outer dimension, and then allocate the inner dimension in a loop:
float** hA = new float*[N];
for (size_t i = 0; i < N; ++i)
hA[i] = new float[N];
The second way is to have a pointer to an array, and allocate that:
float (*hA)[N] = new (float[N])[N];
But all that is moot since you might as well use std::vector
instead:
std::vector<std::vector<float>> hA(N);
for (size_t i = 0; i < N; ++i)
hA[i].push_back(std::vector<float>(N));