#include
#include
using namespace std;
class CStudent
{
public:
char* stu_name;
int stu_numeber;
// 构造函数
CStudent(char* p_name, int p_number)
{
stu_name = p_name;
stu_numeber = p_number;
}
};
int main()
{
vector arr_stu{ {"HuiCui", 999}, {"YuLan", 666} };
// 输出初始化结构
cout << "数组1的名称 = " << arr_stu[0].stu_name << endl;
cout << "数组1的序号 = " << arr_stu[0].stu_numeber << endl;
return 0;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)