柠檬试题库
search
首页
计算机
公务员
驾照
关于
share
有以下定义和语句 struct workers { int num; char name[20]; char c; struct { int day; int month; int year;} s; }; struct workers w,*pw; pw=&w; 能给w中year成员赋1980的语句是
A.pw->year=1980;
B.w.year=1980;
C.w.s.year=1980;
D.*pw.year=1980;
热度🔥808
参考答案:C
解析:
【解析】本题考查结构体变量的引用,题目中定义了一个结构体,其中结构体中的变量又是一个结构体,w为外层结构体,如果给内层结构体赋值,C先要得到内层结构体变量,即w.s,若要给year赋值,表示为w.s.year即可,选项C正确。
复制题目向AI提问
content_copy
content_copy
扫码免费计算机二级刷题
2025年计算机等级考试题库
推荐
有以下程序: #include main() { int b[3][3]={0,1,2,0,1,2,0,1,2},i,j,t=1; for(i=0; i<3; i++) for(j=i;j<=i;j++) t+=b[i][b[j][i]]; printf("%d\n",t); } 程序运行后的输出结果是( )。
有以下程序: # include struct S{int n; int a[20]; }; void f(struct S *p) { int i,j,t; for (i=0; in-1; i++) for (j=i+1; jn; j++) if (p->a[i] > p->a[j]) { t= p->a[i]; p->a[i] = p->a[j]; p->a[j] = t; } } main() { int i; struct S s={10, {2,3,1,6,8,7,5,4,10,9}}; f(&s); for (i=0; i
概念模型是现实世界到信息世界的语义抽象,主要用于数据库设计中的概念设计阶段。下列哪种方法用于该阶段?
下列叙述中正确的是( )。
下列排序方法中,最坏情况下时间复杂度最小的是( )。
标签
二级C语言
year
结构
1980
int