【cpp】new delete

 

 

double *M = new double[2*num];
double *T = new double[2 * num];
double *activeM = new double[2 * num];
double *activeT = new double[2 * num];
double *A = new double[2 * num];

 

delete[] A;
delete[] activeT;
delete[] activeM;
delete[] T;
delete[] M;

注意:

(1)对数组要 delete[]

(2)注意delete的顺序,和new是反过来的。

posted @ 2017-01-09 16:00  xy123001  阅读(201)  评论(0编辑  收藏  举报