/* This is not a complete program */ #include #include typedef float **matrix; matrix mat_create(int row, int column) { float * elements, **rows; int i; /* First allocate the elements: */ elements = (float*)malloc(row*column*sizeof(float)); if (elements == NULL) { return NULL; /* failure to allocate the element array */ } /* Now allocate the rows: */ rows = (float**)malloc(row*sizeof(float*)); if (rows == NULL) { free(elements); /* First return the allocated elements to the available space. */ return NULL; } /* Now load the rows with addresses of the appropriate elements. Successive rows are 'column' floats apart. */ for (i=0; i