C语言结构体单元练习

2026/1/27 0:19:32

15、以下对枚举类型名的定义中正确的是 。

A) enum a={one,two,three}; B) enum a {one=9,two=-1,three}; C) enum a={\D) enum a {\16、下面程序的输出是 。

main()

{ enum team { my,your=4,his,her=his+10}; printf(\

A) 0 1 2 3 B) 0 4 0 10 C) 0 4 5 15 D) 1 4 5 15 17、下述程序的执行结果是 。 #include union un { int i; char c[2]; };

void main( ) { union un x; x.c[0]=10; x.c[1]=1;

printf(\}

A) 266 B) 11 C) 265 D) 138 17、有以下程序

#include struct node { int num;

struct node *next;}; main()

{ struct node *p,*q,*r;

p=(struct node *)malloc(sizeof(struct node)); q=(struct node *)malloc(sizeof(struct node)); r=(struct node *)malloc(sizeof(struct node)); p->num=10; q->num=20; r->num=30; p->next=q; q->next=r;

printf(\p->next->num); }

程序运行后的输出结果是 。

A) 10 B) 20 C) 30 D) 40 18、设有以下说明语句:

typedef struct { int n; char ch[8]; }per;

则下面叙述正确的是 。

A) per是结构体变量名 B) per是结构体类型名 C) typedef是结构体类型 D) struct是结构体类型名

19、若有以下定义:

struct link { int data;

struct link *next; }a,b,c,*p,*q;

且变量a和b之间已经有如右图所示的链表结构:指针p指向变量a,q指向变量c。能够把c插到a和b之间,并形成新的链表的语句组是 。

A) a.next=c;c.next=b; B) p.next=q;q.next=p.next; C) p->next=&c;q->next=p->next; D) (*p).next=q;(*q).next=&b;


C语言结构体单元练习.doc 将本文的Word文档下载到电脑
搜索更多关于: C语言结构体单元练习 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219