单选题
有以下程序
#include
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,",p->next->n);
}
程序运行后的输出结果是_______。
【正确答案】
B
【答案解析】【解析】这是一道简单的链表数值显示。相当于:2, &x[1]→4,&x[2] →6,NULL(结束符),p->n显示为2;p->next-n显示为4。