#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define MAX_SIZE 20
//学生信息结构体
struct stu_information//这里使用了struct结构体
{
char Name[MAX_SIZE];
int Gender;
int Sno;
char ID[MAX_SIZE];
char telephone[MAX_SIZE];
char mailbox[MAX_SIZE];
char Cipher[MAX_SIZE];
}*s;
int num=0;
void EnterPassWard(char *passward);为什么是void
void logon();//这个是什么函数,有什么作用
int main()//这个主函数是在干什么
{
int flag=1;
char Flag,ch;
s=(struct stu_information )malloc(100sizeof(struct stu_information));
char UserName[MAX_SIZE];
char Cipher[MAX_SIZE];
while(1)这个是while选择语句嘛,他在干什么
{
system("cls");//清空有什么作用
printf("请选择一项服务:\n1.登录已有账号\n2.注册新用户\n");
flag=getch();
if(flag==49)
{ system("cls");
printf("输入用户名:");
scanf("%s",UserName);
L1: printf("密码:");
EnterPassWard(Cipher);
flag=CheckIfExist(UserName,Cipher,s);
if(flag==0)
{
printf("密码错误!\n");
goto L1;
}
else if(flag==-1)
{
printf("\n用户不存在!\n");
printf("是否注册新用户?(Y/N)");
getchar();
scanf("%c",&Flag);
if(Flag=='Y'|| Flag=='y')
logon();
}