A-A+
以下程序的运行结果是______。 struct exmp{char name [10];
问题详情
以下程序的运行结果是______。 struct exmp{char name [10]; int number; }; struct exmp test[3]={{"WangXi",1},{"QiYu",2},{"HuHua",3}}; main() {printf("%c,%sn",test[0].name[1],test[2].name+3); }
请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:aua。
test是结构体数组,每个元素均可看作是一个结构体变量,主函数将结构体数组元素test[0]中的name域下标为1的元素以字符形式输出,将结构体数组元素test[2]中的name域从地址name+3开始以字符串的形式输出。