二楼正解。还是同城的厉害啊。
分全给你吧,散了就有点…
大家谅解下。
二楼留个Q。
谨记
分全给你吧,散了就有点…
大家谅解下。
二楼留个Q。
谨记
从来都是无所谓,现在也该学着有所谓。✿咱们一个人,别坐井观天❀
#include <iostream> using namespace std; class X { public: X() : id(count++) {} ~X() { cout << "Destroying: X(" << id << ")" << endl; } private: static int count; const int id; }; int X::count; int main() { X (*a)[10] = new X[2][10]; delete []a; return 0; } /* 输出: Destroying: X(19) Destroying: X(18) Destroying: X(17) Destroying: X(16) Destroying: X(15) Destroying: X(14) Destroying: X(13) Destroying: X(12) Destroying: X(11) Destroying: X(10) Destroying: X(9) Destroying: X(8) Destroying: X(7) Destroying: X(6) Destroying: X(5) Destroying: X(4) Destroying: X(3) Destroying: X(2) Destroying: X(1) Destroying: X(0) */