-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
63 lines (55 loc) · 983 Bytes
/
Copy pathmain.cpp
File metadata and controls
63 lines (55 loc) · 983 Bytes
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
52
53
54
55
56
57
58
59
60
61
62
63
/*
* testmain.cpp
*
* Created on: 2014. 11. 21.
* Author: suandkyu
*/
#include "addressbook.h"
#include <iostream>
using namespace std;
int main() {
int menu = -1;
addressbook *book = new addressbook;
//book->testSetup();
while (menu != 0) {
book->printMainMenu();
cout << "menu: ";
cin >> menu;
cin.sync();
switch (menu) {
case MENU_INPUT:
book->input();
break;
case MENU_REMOVE:
book->remove();
break;
case MENU_MODIFY:
book->modify();
break;
case MENU_SEARCH:
book->search();
break;
case MENU_ALL_PRINT:
book->printAll();
break;
case MENU_SAVE:
book->save();
break;
case MENU_LOAD:
book->load();
break;
case MENU_FINISH:
book->print_finish();
break;
default:
book->print_error(ERROR_NO_MENU);
break;
}
if (menu != MENU_FINISH) {
cin.sync();
cout << endl << "menu 화면으로 돌아갑니다. (아무키나 누르세요)" << endl;
cin.get();
}
}
return 0;
}