const int *p = new const int[10]();
const int *p = new const int[10]();
const int *p = new const int[10];
我在C++primer上看的说第一种已经初始化 没有错误 但是在编译器上为什么没有通过? 还是有错
error C2468: 'new' : cannot allocate 'const'/'volatile' objects (type is 'const int [10]')
[解决办法]
把后面的const去掉,。。。
[解决办法]
const int *p这里已经表示所指内存元素是const的了