您的位置:首页 > 其它

52-结构体的最简单应用

2014-01-20 10:54 176 查看
/* 结构体的初级运用
*/
#include "stdio.h"
#include "conio.h"

//定义一个结构体,并且声明一个结构体变量student1
struct Student{
//学生的编号
int id;
//年龄
int age;

}student1;
main()
{
//对student的成员变量进行赋值
student1.id=1;
student1.age=22;

//输出student的成员变量值
printf("学生的编号是:%d\n学生的年龄是:%d",student1.id,student1.age);
getch();
}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息