c++使用new动态分配数组内存时,可以使用int *p = new int[i]{1,2,3,……,i};也可以先定义int *p = new int[i];p[1] = 1;p[2] = 2;p[3] = 3;...p[i] = i;这两种方法都可以对数组进行动态分配内存和初始化