C语言--结构体变量

#include
#include
#include
/*
	结构体变量
	1、了解结构体变量的赋值
		1.1定义的时候初始化
		1.2先定义后初始化
		1.3用户输入方式初始化


*/

struct _student
{
   
	char name[20];
	int age;
}stu={
   "陈有乐",21};

/*错误写法 因为有typedef 所以stu是别名 而不是变量
typedef struct _student
{
	char name[20];
	int age;
}stu={"陈有乐",21};
*/

typedef struct __MM
{
   
	char name[20];
	int age;
}gridl;

//普通变量可以做的,结构体类型变量也可以做
//1、当做函数参

你可能感兴趣的:(重新开始C语言,c语言)