很久没写C语言的代码,发现很多小细节。
0.C语言常规头文件
#include <stdlib.h>
#include <stdio.h>
1. 二维数组的开辟和释放-malloc()&free()
double ** a; //a[m][n]
a = (double **) malloc (sizeof(double *) *m);
for (int i = 0; i < m; i ++)
a[i] = (double *) malloc (sizeof(double) *n);
for (int i = 0; i < m; i ++){
free(a[i]);
}
free(a);