柠檬试题库
search
首页
计算机
公务员
驾照
关于
share
若有以下程序 #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
热度🔥997
参考答案:D
解析:
【解析】本题中考查结构体中变量的引用,a结构体中name被修改为Qian,所以本题答案为D。
复制题目向AI提问
content_copy
content_copy
扫码免费计算机二级刷题
2025年计算机等级考试题库
推荐
窗体中有命令按钮run34,对应的事件代码如下: Private Sub run34_Enter() Dim num As Integer,a As Integer, b As Integer,i As Integer For i=1 To 10 num=InputBox("请输入数据:","输入") If Int(num/2)=num/2 Then a=a +1 Else b=b+1 End If Next i MsgBox("运行结果:a=" & Str(a)& ",b=" & Str(b)) End Sub 运行以上事件过程,所完成的功能是( )。
下列事件中,不属于窗体事件的是
以下哪个不属于IM系统的主要功能?
下列排序方法中,最坏情况下时间复杂度最小的是( )。
如果定义班级关系如下:班级(班级号,总人数,所属学院,班级学生)则使它不满足第一范式的属性是( )。
标签
二级C语言
name
qian
gender
score