![](https://csdnimg.cn/release/download_crawler_static/87226773/bg7.jpg)
10.2 结构变量(biànliàng)的引用与初始化
[案例10.2] 利用[案例10.1]中定义的结构类型struct std_info,定义一
个结构变量student,用于存储和显示(xiǎnshì)一个学生的基本情况。
#include <stdio.h>
#include "struct.h"
/*定义并初始化一个外部结构变量student */
struct std_info student={"000102","张三","男",{1980,9,20}};
main()
{ printf("No: %s\n",);
printf("Name: %s\n",);
printf("Sex: %s\n",);
printf("Birthday: %d-%d-%d\n",,
student.birthday.month, student.birthday.day);
}
第七页,共38页。