struct matrix { int col, row; double data[1]; // I want the matrix entries stored // right after this struct}
matrix* allocate_matrix(int row, int col) { matrix* m = malloc(sizeof(matrix) + sizeof(double) * (row * col - 1)); m->row = row; m->col = col; return m;}
红糖糍粑
相关分类