I am wondering how exactly this works and if this is even the correct way to do this. It works like I want it to. Basically what I'm doing is creating a float array where all elements are 0 with the height of h and width of w.
float** arr = NULL;
arr = (float**) malloc(sizeof(float*) * h);
for (int i = 0; i < h; ++i) {
arr[i] = (float*) calloc(h, sizeof(float) * w);
}