基本的伪代码如下所示:
第一个cout返回10,正如预期的那样,而第二个cout返回4。有人能解释一下吗?
void myFunction()
{
int size = 10;
int * MyArray;
MyArray = new int[size];
cout << size << endl;
cout << sizeof(MyArray) << endl;
}
第一个cout返回10,正如预期的那样,而第二个cout返回4。有人能解释一下吗?
MyArray
的定义是一个非标准扩展。 - Dennis Zickefoose