在下面的这个程序中,当我把第8行的2改为20时程序才不报错,不修改时会是下述错误.定位new不是给他提供地址就行了么?那个地址还会有要求的?!图片说明](https://img-ask.csdn.net/upload/201609/15/1473945249_525007.jpg)
#include
#include
using namespace std;
int main()
{
double tf[2];
cout << tf << endl;
int* ps = new (tf) int [10];
for (int i = 0; i < 10; i++)
{
ps[i] = i;
}
cout << ps << endl;
cout << ps[9] << endl;
cout << &(ps[9]) << endl;
return 0;
}
运行结果是这样: