A couple of problems, one minor, another more important.
Line 41:
if(GoGoGo!=='y'||GoGoGo!=='Y')
The operator should be either "equal to"
==
or "not equal to"
!-
In this case you presumably want this:
if (GoGoGo!='y' || GoGoGo!='Y')
But then, if the user enters 'n', neither condition is true, so the exit is followed.
What if the user enters 'y'? Well, the first test is false. But the second will be true. So the exit is always taken.
It should actually look like this:
1 2
|
if (GoGoGo!='y' && GoGoGo!='Y')
exit(1);
|
That was the minor problem.
The other one is more serious.
Lines 45 to 47:
1 2 3 4
|
while (GoGoGo=='y'||GoGoGo=='Y')
{
WriteToFile.write(((char*)&s),sizeof(Student));
}
|
If we reach this point, we know that one of the conditions is true, so the while loop is entered. The big question is this:
How does the while loop ever terminate?