C语言结构体

结构体是数组的拓展:

# 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;
}

 

posted @ 2018-12-21 01:06  一文搞懂  阅读(211)  评论(0编辑  收藏  举报