首页 > 编程语言 > 详细

C语言结构体

时间:2018-12-21 10:19:46      阅读:140      评论:0      收藏:0      [点我收藏+]

结构体是数组的拓展:

# include <stdio.h>

struct Student
{
	char name[20];
	int num;
	float score;
};
int main(void)
{
	struct Student student1 = {"小肮", 1207041, 100};
	printf("name=%s  num=%d  score=%.2f",student1.name,student1.num,student1.score);
	return 0;
}

 

C语言结构体

原文:https://www.cnblogs.com/easyidea/p/10153517.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!