赞题库-背景图
单项选择题

有以下程序:
#include<stdio.h>
main()
{struct node{int n; struct node*next; } *p;
struct node x[3]={{2, x+1}, {4, x+2}, {6, NULL}};
p=x;
printf("%d, ", p->n);
printf("%d\n", p->next->n );
}
程序运行后的输出结果是______。

A.2,3
B.2,4
C.3,4
D.4,6
<上一题 目录 下一题>
热门试题

单项选择题有以下程序:#include<stdio.h>#include<string.h>typedef struct{char name[9]; char sex; int score[2]; }STU;STU f(STU a){ STU b={ Zhao , m , 85,90};int i;strcpy(a.name, b.name);a.sex=b.sex; for(i=0; i<2; i++) a.score[i]=b.score[i]; return a;}main(){ STU c={ Qian , f, 95, 92}, d; d=f(c);printf( %s, %c, %d, %d, , d.name, d.sex, d.score[0], d.score[1]); printf( %s, c, %d, %d n , C.name, C.sex, C.score[0], C.score[1]); }程序运行后的输出结果是______。

A.Zhao,m,85,90,Qian,f,95,92
B.Zhao,m,85,90,Zhao,m,85m90
C.Qian,f,95,92,Qian,f,95,92
D.Qian,f,95,92,zhan,m,85,90

单项选择题若有定义语句:“int year=2009, *p=&year;”,以下不能使变量year中的值增至2010的语句是______。

A.*p+=1;
B.(*p)q++;
C.++(*p);
D.*++p