问题
单项选择题
下面程式程序的执行结果是( )。
#include <iostream.h>
void main()
int*p,r;
p=new int;
*p=20;
r=sizeof(*p);
cout<<r<<endl;
delete p;
A.程序错误
B.内存为20地址的大小
C.20
D.4
答案
参考答案:D
下面程式程序的执行结果是( )。
#include <iostream.h>
void main()
int*p,r;
p=new int;
*p=20;
r=sizeof(*p);
cout<<r<<endl;
delete p;
A.程序错误
B.内存为20地址的大小
C.20
D.4
参考答案:D