标题:
求助!!!sizeof的作用
[打印本页]
作者:
gsw247149413
时间:
2010-12-15 11:34
标题:
求助!!!sizeof的作用
书上P107
int main()
{
char *pchar;
double *pdouble;
cout<<sizeof(pchar)<<endl;//sizeof()
cout<<sizeof(*pchar)<<endl;
cout<<sizeof(pdouble)<<endl;
cout<<sizeof(*pdouble)<<endl;
return 0;
}
输出4148
SIZEOF到底怎么分辨出他是指针?
作者:
fwbook
时间:
2010-12-15 13:00
sizeof不会去分辨是否为指针。他只会判断括号内元素所存储的值。
欢迎光临 万卷图书 (http://wanjuanchina.net/)
Powered by Discuz! 7.0.0