c++写结构体嵌套 引发了异常: 读取访问权限冲突。 _Pnext 是 0xD0。

是在第二个for循环那报错了,但是不知道是什么错误,求指导


struct Student
{
    string stuName;
    int score;
};

struct Teacher
{
    string tName;
    Student stuArray[5];
};

void allocateSpace(Teacher tArray[] , int len)
{
    string teacherName = "Teacher_";
    string studentName = "Student_";
    string nameSeed = "ABCDE";
    for (int i = 0; i < len; i++)
    {
        tArray[i].tName = teacherName + nameSeed[i];

        for (int j = 0; j < 5; j++)//这里报错了
        {
            tArray[i].stuArray[j].stuName = studentName + nameSeed[j];
            tArray[i].stuArray[j].score = 100;
        }
    }
}


void printInfo( Teacher tArray[], int len)
{
    for (int i = 0; i < len; i++)
    {
        cout << "教师姓名:" << tArray[i].tName << endl;
        for (int j = 0 ; j < 5 ; j++)
        {
            cout << "\t学生姓名:" << tArray[i].stuArray[j].stuName << "  分数: " << tArray[i].stuArray[j].score << endl;
        }
    }

}

int main()
{
    Teacher tArray[3];
    //传入参数
    int len = sizeof(tArray) / sizeof(tArray[0]);
    allocateSpace(tArray, len);
    //打印信息
    printInfo(tArray, len);

    system("pause");
    return 0;
}

```c++

```

tArray[i].tName = teacherName + nameSeed[i];
这一行在VS2010上编译都通过不了,string+char不支持