-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
49 lines (44 loc) · 1.08 KB
/
main.c
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
45
46
47
48
49
#include <stdio.h>
#include <stdlib.h>
#include "manage.h"
void main_menu(void) {
printf("\nPassword Manager\n");
printf("1. Add a Password\n");
printf("2. Retrieve a Password\n");
printf("3. Delete a Password\n");
printf("4. List All Services\n");
printf("5. Exit\n");
printf("Choose an option: ");
}
int main(void) {
int choice;
initialize_file();
while (1) {
main_menu();
if (scanf("%d", &choice) != 1) {
printf("Invalid input. Exiting.\n");
break;
}
switch (choice) {
case 1:
add_password();
break;
case 2:
retrieve_password();
break;
case 3:
delete_password();
break;
case 4:
list_services();
break;
case 5:
printf("Exiting...\n");
exit(0);
break;
default:
printf("Invalid option. Please try again.\n");
}
}
return 0;
}