单选题 C语言
题号 #2252776

有以下程序:
#include<<stdio.h>
struct stu
{ int num;
char name[10]:
int age;}
void fun(struct stu*p)
{printf("%s\n",(*p).name);}
the main()
{
struct stu students[3]={{9801,"Zhang".20},
{9802,"Wang",19},{9803,"Zhao",1 8}}
fun(students+2);
}
输出的结果是(    )。

进入在线模考

参考答案

B

答案解析

 
从实参传递过去的是结构体系数组的第3个元素,所以输出的name为Zhao。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考