柠檬试题库
search
首页 计算机 公务员 驾照 关于

若有以下程序 #include #include #include struct stu { char *name, gender; int score; }; main() { struct stu a={NULL, 'm', 290}, b; a.name=(char *)malloc(10); strcpy(a.name, "Zhao"); b = a; b.gender = 'f'; b.score = 350; strcpy(b.name, "Qian"); printf( "%s,%c,%d,", a.name, a.gender, a.score ); printf( "%s,%c,%d\n", b.name, b.gender, b.score ); } 则程序的输出结果是


  • A.Zhao,m,290,Zhao,f,350
  • B.Zhao,m,290,Qian,f,350
  • C.Qian,f,350,Qian,f,350
  • D.Qian,m,290,Qian,f,350
热度🔥846
参考答案:D
解析:打开微信小程序查看本题解析