16,473
社区成员
发帖
与我相关
我的任务
分享
类型一样 大小一样..怎么会不一致?
#include <iostream>
using namespace std;
int main()
{
int * p = new int;
cout<< sizeof(*p) << "\t" << sizeof(p[0])<<endl;
cout<< typeid(*p).name() << "\t" << typeid(p[0]).name() <<endl;
delete p;
return 0;
}