结 构 体
一、结构体
数据类型——构造出来——一组数据 (不同数据类型)
面向对象
二、语法
1、定义
Struct 结构体名 { 成员表; 成员函数; }结构体变量表;
|
struct student{ int num; string name; bool sex; }a[62]; |
Struct 结构体名 { 成员表; 成员函数; }; 结构体名 结构体变量表; |
struct student{ int num; string name; bool sex; }; Student a[62]; |
*定义结构体时系统不分配内存,只有定义结构体变量时,才分配内存。
<