-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
51 lines (44 loc) · 1.15 KB
/
main.c
File metadata and controls
51 lines (44 loc) · 1.15 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
45
46
47
48
49
50
51
#define _CRT_SECURE_NO_WARNINGS
#include "kulender.h"
int main(void) {
int checkDir1 = _access("kulender", 0); // 기존 파일 존재 유무 채크
if (checkDir1 == -1) { // 기존에 파일이 존재하지 않을때
if (_mkdir("kulender") != 0) {
printf("Cannot make dir \"Kulender\"\n");
return 0;
}
}
int checkDir2 = _access("kulender\\users", 0);
if (checkDir2 == -1) {
if (_mkdir("kulender\\users") != 0) {
printf("Cannot make dir \"Kulender\\users\"\n");
return 0;
}
}
int checkDir3 = _access("kulender\\groups", 0);
if (checkDir3 == -1) {
if (_mkdir("kulender\\groups") != 0) {
printf("Cannot make dir \"Kulender\\groups\"\n");
return 0;
}
}
while (1) {
system("cls");
printf("--------------KULENDER--------------\n");
printf("1. 로그인\n");
printf("2. 회원가입\n");
printf("3. 시스템 종료\n");
printf("------------------------------------\n");
printf("메뉴 선택 : ");
int num = chooseNumber(1, 3);
switch (num) {
case 1:
if (login() == -1)
return 0;
else
break;
case 2: makeAccount(); break;
case 3: return 0; //시스템 종료 -> 메모리 leak..
}
}
}