And the teacher and the student login name and password how to separate (as follows)
/* verify student and teacher account password */
Void checkAccountandPassword (TotalNode * phead, char * Account, Password, char * int n)
{
While (1)
{
Gets (studentAccount);
/* */
If (0==STRCMP (Account, "wantin"))
{
While (1)
{
Printf (" please enter the password: ");
Gets (studentPassword);
If (0==STRCMP (studentPassword, "123456"))
{
Display_Detailed (phead, Account, n);
return;
}
}
}
The else
{
Printf (" please enter account: ");
}
}
}
{
While (2)
{
Gets (teacherAccount);
/* */
If (0==STRCMP (Account, "wanti"))
{
While (1)
{
Printf (" please enter the password: ");
Gets (teacherPassword);
If (0==STRCMP (teacherPassword, "123457"))
{
Display_Detailed (phead, Account, n);
return;
}
}
}
The else
{
Printf (" please enter account: ");
}
}
}
/* check students, teachers, 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:
While (2) a few meaning of this? Belong to which function?CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.htmlI hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html