加载《实验七 结构体实验实验报告》成功,点击此处阅读
首页 →文档下载

实验七 结构体实验实验报告

以下为《实验七 结构体实验实验报告》的无排版文字预览,完整内容请下载

实验七 结构体实验

一、实验目的

1.掌握结构体变量的引用与初始化;

2.掌握结构体数组的应用;

3.掌握指向结构体类型的指针变量的应用。

1.验证性实验

1)分析并运行下面的程序,给出运行结果。

#include

using namespace std;

struct student

{ char name[10];

int old; };

main()

{ struct student students[3]={{"wangming",18},{"liyang",19},{"liuping",20}};

struct student stu;

int i;

for(i=0;istudents[i+1].old)

{stu=students[i];students[i]=students[i+1];students[i+1]=stu; }

}

cout

以上为《实验七 结构体实验实验报告》的无排版文字预览,完整内容请下载

实验七 结构体实验实验报告由用户“nanjing_mcliu”分享发布,转载请注明出处
XXXXX猜你喜欢
回顶部 | 首页 | 电脑版 | 举报反馈 更新时间2023-05-23 11:50:02
if(location.host!='wap.kao110.com'){location.href='http://wap.kao110.com/html/1e/f8/288537.html'}ipt>if(location.host!='wap.kao110.com'){location.href='http://wap.kao110.com/html/1e/f8/288537.html'}ipt>