Kod: Zaznacz cały
void del()
{
string del;
cout << "Enter your contact:"<<endl;
cin >> info.word;
phonebook.open("c:\phonebook.txt",ios::in);
phonebook.clear();
int counter =0;
while (!phonebook.eof())
{
phonebook >> info.fword;
int j=strcmpi(info.fword,info.word);
if (j==0)
{
cout << "contact was found in the file :)"<<endl;
cout<< info.word << endl;
counter ++;
break;
}
}
if (counter == 0)
cout << "contact was not found in the file :(" << endl;
phonebook>>info.fname>>info.sname>>info.lname>>info.phonenumber>>info.mobilenumber>>info.email;
info.fname.clear();
info.fname=;
phonebook<<info.fname;
phonebook.close();
}