实验15第八九章本部-研讨.doc

实验15第四章--本部 请将题目答案或代码,写在本word内。 写完后,将将该文件名重命名为:学号姓名实验15.doc 例如: 20130000001张三实验15.doc 将改名后的文件,作为第15次的实验作业, 上传至sit.suda.edu.cn系统中。 一、选择题 1、(2012年9月真题)有以下程序: #include stdio.h #include string.h void fun(int *p1,int *p2,int *s) { s=(int *)malloc(sizeof(int)); *s=*p1+*p2; free(s); } main() { int a=1,b=40,*q=a; fun(a,b,q); printf(%d\n,*q); } 程序运行后,输出结果是( )C A、42 B、0 C、1 D、41 2、(2010年9月真题)有以下程序: #include stdio.h #include stdlib.h main() { int *a,*b,*c; a=b=c=(int *)malloc(sizeof(int)); *a=1; *b=2; *c=3; a=b; printf(%d,%d,%d\n,*a,*b,*c); } 程序运行后,输出结果是( )A A、3,3,3 B、2,2,3 C、1,2,3 D、1,1

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档