题目内容

有以下程序:#includestruct stud{ int num; char sex;};void func( struct stud b){ b.num = 1002; b.sex = 'f';}int main(){ struct stud s = {1001,'m'}; func(s); printf("%d,%c\n",s.num ,s.sex);}该程序的运行结果是:______

查看答案
更多问题

已知:struct { float a,b,c;}ex;则sizeof(ex)的值是( )。

A. 4
B. 6
C. 8
D. 12

设有定义:struct{ char mark[12]; int num1; double num2;}t1, t2;,若变量均已正确赋初值,则以下语句中错误的是( )。

A. t1 = t2;
B. t2.num1 = t1.num;
C. t2.mark = t1.mark;
D. t2.num2 = t1.num2;

以下对结构体变量stu1中成员num的非法引用是( )。struct student{ int num; char sex;}stu1, *p;

A. stu1.num
B. student. num
C. p->num
D. (*p). num

有以下函数,分析该函数的功能是( )。int fun(char *s){ char *t = s; while( *t++); return (t-s);}

A. 计算s所指字符串的长度
B. 比较两个字符串的大小
C. 计算s所指字符串占用内存字节的个数
D. 将s所指字符串复制到字符串t中

答案查题题库