float **matrix;
// allocate memory for m pointers to beginning of rows
matrix = malloc(m * sizeof(float *));
assert(matrix != NULL);
// allocate memory for the elements in each row
int i;
for (i = 0; i < m; i++) {
matrix[i] = malloc(n * sizeof(float));
assert(matrix[i] != NULL);
}