题目内容

已知字符0的ASCII代码值的十进制数是48,有以下程序: #include <stdio.h> main() { union { int i[2]; long k; char c[4]; } r, *s=&r; s->i[0]=0x39; s->i[1]=0x38; printf("% x\n", s->c[0]); } 其输出结果是______。

A. 39
B. 9
C. 38
D. 8

查看答案
更多问题

以下程序的执行结果是______。 #include <stdio.h> union un { int i; char c[2]; } main() { union un x; x.c[0]=10; x.c[1]=1; printf("\n% d", x.i); }

A. 266
B. 11
C. 265
D. 138

设有以下说明语句: struct stu { int a; float b; } stutype; 则下面的叙述,正确的是______。

A. struct是结构体类型名
B. struct stu是用户定义的结构体变量名
C. stutype是用户定义的结构体变量名
D. a和b都是结构体变量名

以下程序的输出结果是______。 #include <stdio.h> int a[3][3]={1,2,3,4,5,6,7,8,9}, *p; f(int *s, int p[][3]) { *s=p[1][1]; } main() { p=(int *)malloc(sizeof(int)); f(p, a); printf("% d\n", *p); free(p); }

A. 1
B. 4
C. 7
D. 5

以下程序的输出是______。 #include <stdio.h> main() { struct s1 {int x; int y;}; struct s1 a={1,3}; struct s1 *b=&a; b->x=10; printf("% d% d\n", a.x, a.y); }

A. 13
B. 103
C. 310
D. 31

答案查题题库