/* validate student account password */
Void checkAccountandPassword (TotalNode * phead, char * Account, Password, char * int n)
{
While (1)
{
Gets (Account);
/* */
If (0==STRCMP (Account, "GFN))
{
While (1)
{
Printf (" please enter the password: ");
Gets (Password);
If (0==STRCMP (", "123456"))
{
Display_Detailed (phead, Account, n);
return;
}
}
}
The else
{
Printf (" please enter account: ");
}
}
}
/* check students, teacher's account password */
Void checkPerson_Msg (TotalNode * phead, int n)
{
The switch (n)
{
Case 1://student login char studentAccount [20]. Char studentPassword [20].
CheckAccountandPassword (phead, studentAccount studentPassword, n);
break;
Case 2://teachers login char teacherAccount [20]. Char teacherPassword [20].
CheckAccountandPassword (phead, teacherAccount teacherPassword, n);
break;
Default:
Puts (" exception!" );
break;
}
}
/* */
CodePudding user response:
CheckPerson_Msg function the second parameter is not used to distinguish theStudents, you pass in 1, the teacher introduced to 2
CodePudding user response: