1 double** p = new doube*[5600];
2 for (int i=0; i<5600; i++)
3 {
4 p[i] = new double[5600];
5 }
2 for (int i=0; i<5600; i++)
3 {
4 p[i] = new double[5600];
5 }
释放:
1 for (int i=0; i<5600; i++)
2 {
3 delete [] p[i];
4 }
5 delete [] p;
2 {
3 delete [] p[i];
4 }
5 delete [] p;
C语言:
1 double** p = (double**) malloc( 5600*sizeof(double*) );
2 for (int i=0; i<5600; i++)
3 {
4 p[i] = (double*) malloc( 5600*sizeof(double) );
5 }
2 for (int i=0; i<5600; i++)
3 {
4 p[i] = (double*) malloc( 5600*sizeof(double) );
5 }
释放:
1 for (int i=0; i<5600; i++)
2 {
3 free( p[i] );
4 }
5 free( p ) ;
2 {
3 free( p[i] );
4 }
5 free( p ) ;