- 1
- 0
- 约1.07千字
- 约 2页
- 2026-07-18 发布于北京
- 举报
Ch13练习题
一.选择题:
1.已知:int*p;使用“p=malloc(sizeof(int)*3);”语句动态申
请int型的单元,应当添加:
A.int
B.int*
C.(*int)
D.(int*)
2.如下程序段结束后,该部分堆区内存的内容为:
char*cptr=(char*)malloc(40);
int*nptr=(int*)cptr;
for(inti=0;i3;i+=1){
*cptr=a;
Cptr+=1;
}
*(nptr+1)=10;
A.前3字节皆为‘a’的ASCII码,接着为1字节的随机内容,
接着为4字节的整数10
B.前4字节皆为‘a’的ASCII码,接着为4字节的整数10
C.前3字节为随机内容,接着1字节为‘a’的ASCII码,接着
4个字节
原创力文档

文档评论(0)