new type[][]的疑惑
程序代码:
#include<iostream> using namespace std; class test { public: operator int() { return i; } test(int k = 1):i(k) { cout << "test" << ' '; } ~test() { cout << "~test" << ' '; } int i; }; int main() { test (*P)[5] = new test[4][5]; delete []P; system("pause"); return 0; }一句delete[]P就可以释放整个数组,求编译器是什么解释new[][].又是什么处理delete []P;