结构体数组:有一个数组,每个元素是一个结构体类型。

#include <stdio.h>
#include <stdlib.h>
struct Teach
{
    char teaName[10];
    int teaAge;
};
int main(void)
{

    struct Teach tea[3] = { {"小赵",11},{"小李",12},{"小吴",14} };

    printf("%s,%d\n", tea[0].teaName, tea[0].teaAge);
    system("pause");
    return 0;
}

 

 posted on 2019-03-15 21:42  轻舞飞扬的饼  阅读(131)  评论(0编辑  收藏  举报