Why do i encounter a crash when creating a 2d array instance with type of another class? [closed]

when i was working on a task of creating 3 classes; student, course, ID. I made a 2d allocated instance inside "course" class called enrolledStudent the type is Student. Then i allocated it in my constructor to have dimensions of(numberOfenrolledStudents,1). When i tried to access the a member of an element of this array
enrolledStudent[1][1].getName();
The program crashes. I could not use any element of my array, is there a reason why this is happening? Thanks in advance.

Source: Windows Questions C++

LEAVE A COMMENT