单项选择题
有以下结构体说明和变量定义,如图所示,指针p、 q、 r分别指向一个链表中的三个连续结点。
struct node
int data;
struct node *next;
} *p, *q, *r;
现要将q和r所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序是
A.r->next=q; q->next=r->next; p->next=r;
B.q->next=r->next; p->next=r; r->next=q;
C.p->next=r; q->next=r->next; r->next=q;
D.q->next=r->next; r->next=q; p->next=r;
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
设有如下定义 struct ss { char name[10]; int age;, char sex; } std[3],* p=std; 下面各输入语句中错误的是
A.scanf("%d",&(*p).age);
B.scanf("%s",&std.name);
C.sean("%c",&std[0].sex);
D.scanf("%c",&(p->sex));
点击查看答案&解析
单项选择题
有以下程序 main ( ) int x[] = {1, 3, 5, 7, 2, 4, 6, 0
有以下程序
main ( )
int x[] = {1, 3, 5, 7, 2, 4, 6, 0
点击查看答案&解析
相关试题
以下程序中函数f的功能是将n个字符串按由大...