如果有下面的定义和赋值struct SNode{ unsignedid;intdata;}n,*p;p=n; .不能输出n中data的值的是()A.p.dataB.n.dataC.p->dataD.(*p).data

如果有下面的定义和赋值struct SNode{ unsignedid;intdata;}n,*p;p=&n; .不能输出n中data的值的是()

A.p.data

B.n.data

C.p->data

D.(*p).data


参考答案和解析
struct st a; a.x=10;

相关考题:

有以下程序:struct s{ int x,y; }data[2]={10,100,20,200};main(){ struct s *p=data;printf("%d\n",(++p)-x);}程序运行后的输出结果是( )。A.10 B.11 C.20 D.21

若有以下说明和语句:sturct st { int n;char *ch;}; struct st a[3]={5, "abc",7, "def",9, "ghk"},*p=a;则值为6的表达式是( )。A)p++-n B)p-n++C)(*p).n++ D)++p-n

设有定义:int n1=0,n2,*p=n2,*q=n1;,以下赋值语句中与n2=n1;语句等价的是()。A)*p=*q; B)p=q;C)*p=n1; D)p=*q;

设有定义:int n1=0,n2,*p=n2,*q=n1;,下列赋值语句中与n2=n1;语句等价的是 ( )。A.*p=*q;B.p=q;C.*p=n1;D.p=*q;

设有定义:int n=0,*p=n,**q=p;,则以下选项中,正确的赋值语句是( )。A.p=1;B.*q=2;C.q=p;D.*p=5;

请补充函数fun(),该函数的功能是建立一个带头结点的单向链表并输出到文件“out98.dat”和屏幕上,各结点的值为对应的下标,链表的结点数及输出的文件名作为参数传入。注意:部分源程序给出如下。请勿改动主函数main 和其他函数中的任何内容,仪在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include<stdio. h>include<conio. h>include<stdlib. h>typedef struct ss{int data;struct ss *next;} NODE;void fun(int n,char*filename){NODE *h,*p, *s;FILE *pf;int i;h=p= (NODE *) malloc (sizeof (NODE));h->data=0;for (i=1; i {s=(NODE *)malloc (sizeof (NODE));s->data=【 】;【 】;p=【 】}p->next=NULL;if ( (pf=fopen (filename, "w") ) ==NULL){printf {"Can not open out9B.clat! ");exit (0);}p=h;fprintf (pf, "\n***THE LIST***\n");print f ("\n***THE LIST***\n")while (p){fprintf (pf, "%3d", p->data)printf ("%3d",p->data);if (p->next ! =NULL){fprintf (pf, "->");printf ("->");}p=p->next;}fprintf (pf, "\n");printf ("\n");fclose (pf);p=h;while (p){s=p;p=p->next;free (s);}}main(){char * filename="out98. dat";int n;clrscr ();printf (" \nInput n: ");scanf ("%d", n);fun (n, filename);}

有以下程序}struct s{ int x,y; } data[2]={10,100,20,200};}main( )}{ struct s *p=data;}printf("%d\n",++(p->x));}程序运行后的输出结果是A.10B.11C.20D.21

设有定义:int n=0,*p=n,**q=p;,则以下选项中,正确的赋值语句是 ______。A.p=1;B.*q=2C.q=pD.*p=5

设有以下程序段:struct st{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++->nB.p->n++C.(*p).n++D.++p->n

若有以下说明和语句: struct st{int n;char*ch;} struct st a[3]={5,"abc"7,"def",9",ghk"),*p=a; 则值为6的表达式是______。A.p++->nB.p->n++C.(*p).n++D.#NAME?

有以下程序: #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,3B.2,4C.3,4D.4, 6

设有如下定义:struct sk{ int n;float x; } data, *p;若要使p指向data中的n域,正确的赋值语句是A.p=data.n;B.*p=data.n;C.p=(struct sk*)data.n;D.p=(struct sk*)data.n;

若有以下说明和语句: struct st{int n;char * ch;}; struct st a[3]={5,"abc",7,"def",9,"ghk"},*p=a; 则值为6的表达式是 ______。A.p++->nB.p->n++C.(*p).n++D.++p->n

设有以下程序: struct st{int n;struct st *next;}; static struct st a[3]={5,a[1],7,struct st *next;}; static struct st a[3]={5,a[1],7,a[2],9,'\0'},*p; p=a [0]; 下面选项中,表达式值为6的是______。A.p++->nB.p->n++C.(*p).n++D.++p->n

设有以下语句 ( ) struct st {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+ + ->nB.p->n + +C.(* P). n+ +D.+ +p - >n

若有以下定义和语句 struct a{ int n,m;}; struct a st[3]={{2,3},{4,5},{6,7}}; struct a*p=st;则以下错误的引用是A.(p++)-n; B.st[0].n; C.(*p).n; D.P=st.m,

设有以下语句: struct st{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++->nB.p->n++C.(*p).n++D.++p->n

设有如下定义: 若要使P指向data中的n域,正确的赋值语句是( )。A. B. C. S 设有如下定义:若要使P指向data中的n域,正确的赋值语句是( )。A.B.C.D.

设有定义:int nl=0,n2,*p=n2,*q=n1;,下列赋值语句中与n2=n1;语句等价的是( )。A.*p=*q;B.p=q;C.*p=n1;D.p=*q;

有以下程序#ncludestdio.hmain(){ struct node{int n;struct nodc*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,3B.2,4C.3,4D.4,6

设有以下程序: struct st{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++->nB.p->n++C.(*p).n++D.++p->n

以下C语言程序的输出结果是( )。struct s{int x,y;}data[2]={10,100,20,200};main( ){struct s*p=data;p++;printf(“%d\n”,++(p->x));}A.10B.11C.20D.21

设有C语句:struct T{int n;double x;}d,*p;,若要使p指向结构体变量中的成员n,正确的赋值语句是()A、p=d.nB、*p=d.nC、p=(struct T *)d.nD、p=(struct T *)d.n

有定义:int a[10], n, *p1=a,*p2=a[9];,则正确的赋值语句为()。A、n=p2-p1;B、n=p2*p1;C、n=p2+p1;D、n=p1/p2;

若已定义   struct num{    int a;    int b;   float f;  } n={1,3,5.0};  struct num *p=n;  则表达式p-b/n.a*++p-b的值是  ①  ,表达式(*p).a+p-f的值是  ②  。

设有定义:intn1=0,n2,*p=n2,*q=n1;,以下赋值语句中与n2=n1;语句等价的是()A、*p=*q;B、p=q;C、*p=n1D、p=*q;

问答题若已定义   struct num{    int a;    int b;   float f;  } n={1,3,5.0};  struct num *p=n;  则表达式p-b/n.a*++p-b的值是  ①  ,表达式(*p).a+p-f的值是  ②  。

单选题设有C语句:struct T{int n;double x;}d,*p;,若要使p指向结构体变量中的成员n,正确的赋值语句是()Ap=d.nB*p=d.nCp=(struct T *)d.nDp=(struct T *)d.n