-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.c
More file actions
44 lines (40 loc) · 1.29 KB
/
Main.c
File metadata and controls
44 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
struct User
{
char name[20];
char username[20];
char password[20];
};
int main()
{
char username[20], password[20];
int x, n, a;
struct User U;
system("COLOR 60");
printf("\t\t******************************Welcome to Postcard********************************************\n");
printf("\t\t\t1.New User\n\t\t\t2.Existing user\n\t\t\t3.Quit\n\t\t\tEnter choice: ");
//scanf("%d", &a);
fflush(stdin);
scanf("%d", &a);
do
{
system("cls");
switch(a)
{
case 1 : NewLogin();
break;
case 2 : printf("\n\tEnter Username or EOF to quit: ");
scanf("%s", username);
if(strcmp(username, "EOF")!=0)
{
printf("\n\tEnter Password: ");
scanf("%s", password);
}
if((ReadUser(username, password))==1)
Exist(username);
break;
case 3 : exit(0);
default : main();
}
}while(a!=3);
return 0;
}