-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainDelMenu.cpp
More file actions
41 lines (39 loc) · 923 Bytes
/
MainDelMenu.cpp
File metadata and controls
41 lines (39 loc) · 923 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
// MainDelMenu.cpp: implementation of the MainDelMenu class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MainDelMenu.h"
MainDelMenu::doMainStrategy()
{
int num = contact_item.size();
int index = 0;
string addr = ".\\contact\\";
system("cls");
cout<<endl;
cout<<"=====Delete Contact====================\n\n";
if (num > 1){
printAll();
cout<<"\n\tEnter the INDEX(1 - "<<num<<") of the information you want to DELETE:(0 for quit) ";
cin.clear();
cin.sync();
cin>>index;
if ((index<0) || (index>num)){
cout<<"\n\n\t\tError Input!\n";
cin.clear();
cin.sync();
getch();
index = 0;
}
}
else if ( num == 1)
index = 1;
if (index == 0)
return 0;
index--;
print_prsn(*contact_item[index],"=====Delete Contact====================\n",true);
delete_prsn(*contact_item[index]);
cin.clear();
cin.sync();
getchar();
return 0;
}