//2.删除指定联系人
void deletePerson(Addressbooks *abs){
cout<<"请输入要删除的联系人:"<<endl;
string name;
cin>>name;
int ret=isExist(abs,name);//ret=-1则是没有查到这个人,ret=1则是查到了
if(ret!=-1){
for(int i=ret;i<abs->m_Size;i++){
abs->PersonArray[i]=abs->PersonArray[i+1];//数据前移,让i+1覆盖第i个数据
}
abs->m_Size--;
cout<<"您已完成删除!"<<endl;
}
else{
cout<<"查无此人!"<<endl;
}
}
03-18
485
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)