I am new to C++, obviously, and I have to write a program for a class. The program should be very simple. it asks to make a structure for a Student that includes the students name and a 2x3 array that represents two semesters with three grades each. Please don't fall down laughing when you see my code. Here are my problems. First the nested loop crashes and second I don't think I am correctly formating my cin.getline statments correctly either. Help!!!
void main(void)
{
int Cnt,
d,
e;
do{
for (Cnt = 0; Cnt <= 4; Cnt++)
{
cout << "Please enter the Students Name: ";
cin.getline(Student[Cnt].Name, 29);
if (Student[Cnt].Name == '\0')
break;
for(d = 0; d < 1; d++)
{
cout << "Please enter students grades for semester " << (d + 1);
cin >> Student[Cnt].Grade[d][e];
for(e = 0; e < 2; e++)
{
cout << "Grade #" << e << endl;
cin >> Student[Cnt].Grade[d][e];
}
}
}
}
}