C++结构体_结构体作用-CSDN博客

网站介绍:文章浏览阅读53次。结构体定义和使用语法:struct 结构体名 { 结构体成员列表 };通过结构体创建变量的方式有三种:struct 结构体名 变量名struct 结构体名 变量名 = { 成员1值 , 成员2值…}定义结构体时顺便创建变量#include <iostream>#include <string>using namespace std;struct student{ string name; int age;}stu3;// 方式3:定义了一个_结构体作用