请判断下面程序的运行结果()#include<stdio.h>int main(){structKeyWord{charKey[20];intID;}kw[]={"void",1,"char",2,"int",3,"float",4,"double",5};printf("%c,%d\n",kw[3].Key[0],kw[3].ID);}(10.0分)A i, 3B n, 3C f, 4D l, 4
1 回答
MYYA
TA贡献1868条经验 获得超4个赞
选C
kw可以写清楚点:
struct kw[]={{ "void" ,1},{ "char" ,2},{ "int" ,3},{ "float" ,4},{ "double" ,5}}; |
分开来写就是:
kw[0] = { "void" ,1}; kw[1] = { "char" ,2}; kw[2] = { "int" ,3}; kw[3] = { "float" ,4}; kw[4] = { "double" ,5}; |
很显然kw[3].Key[0]就是float的第一个字符也就是f
kw[3].ID就是4
添加回答
举报
0/150
提交
取消