#include <iostream>
using namespace std;
#include <cstring>
#include <ctime>
struct Student
{
string sName;
int score;
};
struct Teacher
{
string tName;
struct Student sArray[5];
};
void allocatespace(struct Teather tArray[3], int tlen)
{
for (int i = 0; i < tlen; i++)
{
string nameseed = "ABCDE";
tArray[i].tName = "teacher_";
tArray[i].tName += nameseed[i];
for (int j = 0; j < 5; j++)
{
tArray[i].sArray[j].sName = "student_";
tArray[i].sArray[j].sName += nameseed;
tArray[i].sArray[j].score =rand()%61+40;
}
}
}
void printInfo(struct Teacher tArray[], int tl
麻烦各位帮我看一下哪里出错了,用的vs2022,allocatespace函数里面所有tArray全显示报错
最新推荐文章于 2023-06-01 20:20:43 发布