Hi there!
I will get to the point.
I have a list of contacts.
I can delete the contact that I want, I put all the fields in blank with a if but the position of the contact remains there.
Code:
if((strcmp(agenda[i].name, delete_name)) == 0){
agenda[i].name[0] = '\0';
agenda[i].phonenumber[0] = '\0';
agenda[i].email[0] = '\0';
break;
}
For example I have 10 contacts, 0-9 in my counter, and I delete the position 5 (the sixth contact), and after a list the contacts and the position remains there.
I know how to solve the problem, but I don't know how to do it, for example by copying the last position to the position that was deleted and make "number_of_contacts--".
Probably this is very easy but i'm having trouble with this