有以下定义和语句struct stu{int n;struct st *next;};
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/23 08:47:32
有以下定义和语句struct stu{int n;struct st *next;};
static struct st a[3]={5,&a[1],7,&a[2],9,'\0'},*p;
p=&a[0];,则值为6的表达式是
A.p++->n B.p->n++ C.(*p).n++ D.++p->n
求详解
static struct st a[3]={5,&a[1],7,&a[2],9,'\0'},*p;
p=&a[0];,则值为6的表达式是
A.p++->n B.p->n++ C.(*p).n++ D.++p->n
求详解
D.其实是一个链表,p->n指的就是其中的值,p++则指向下一个元素.
A p++->n相当于(&a[0]->n),于是是5
B p->n++相当于(&a[0]->n)++,也是5
C (*p).n++相当于(a[0].n)++,结果也是5
D ++p->n相当于++(p->n),结果6
A p++->n相当于(&a[0]->n),于是是5
B p->n++相当于(&a[0]->n)++,也是5
C (*p).n++相当于(a[0].n)++,结果也是5
D ++p->n相当于++(p->n),结果6
有以下定义和语句struct stu{int n;struct st *next;};
A.若有以下说明和语句:struct stu { int no; char *name; }student,*p=&st
有以下定义的链表struct st{int n,struct st *next;}a[3]={5,&a[1],7,&a[
typedef struct node { int data; struct node *next; } NODE,*n
已知有定义和声明: struct {int x;}a[4]={{1},{1},{4},{6}},b; 以下语句中语法正确
答案为什么选B?设有以下程序段,则值为6的表达式是( ).struct st{ int n; struct st *ne
struct student{int num,int score}stu; struct student *p;stu
第一行 type TYPE *creat(int n) { struct stu *head,*pf,*pb; int
typedef struct node { int data; struct node *next; }Node,*Li
c语言的一道题若有以下程序段:struct st{int n;int *m;};int a=2,b=3,c=5;stru
#include main() { struct node{int n;struct node *nest;} *p;
C语言习题(结构 )单选题1.有以下定义:struct { int x;int y;} a={ 5,7},*p=&a;