@OP - You have a problem with nameCheck and numberOfStudents.
If your edit check fails, you make a recursive call to the same function. That would work, but you're not returning the value from the nested call. i.e. If the first name you enter is longer than 30, you make a recursive call. If the second attempt is valid, the nested call will return a valid name, but that name is lost and the outer call will return an empty string.
IMO, using recursion for an edit check is poor style and not an appropriate use of recursion. I can't tell from the code you posted if you have been introduced to do {} while () loops.
A better example of nameCheck would be:
1 2 3 4 5 6 7 8
string nameCheck()
{ string name;
do
{ cin >> name;
}
while (name.length() > 30);
return name;
}
edit: You might also want to check that the length of the name is greater than 0, assuming that a name is required.