基本信息
文件名称:C语言程序设计教程:结构体与枚举应用实例.pdf
文件大小:889.68 KB
总页数:26 页
更新时间:2026-02-11
总字数:约2.82万字
文档摘要

7.2阅读程序,指出程序的输出结果。

(1)#includestdio.hstructs{intx;int

y;}cnum[2]={1,3,2,7};main(){printf(%

d\n,cnum[0].y*cnum[1].x);}(2)#include

stdio.h#includestdlib.h

structNODE{intnum;struct

NODE*next;};

main(){structNODE*p,*q,*r;p=(struct

NODE*)malloc(sizeof(structNODE));q=(struct

NODE*)malloc(si