Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void delete_()
- {
- int i,n;
- for(i=0; i<counter; i++)
- printf("%d)first name: %s\nlast name: %s\nAddress: %s\nCity: %s\nNumber: %s\n",i+1,person[i].fname,person[i].lname,person[i].address,person[i].city,person[i].number);
- printf("enter the number of contact you want to delete: ");
- scanf("%d",&n);
- n--;
- for(i=n; i<=counter; i++)
- {
- strcpy(person[i].fname,person[i+1].fname);
- strcpy(person[i].lname,person[i+1].lname);
- strcpy(person[i].address,person[i+1].address);
- strcpy(person[i].city,person[i+1].city);
- strcpy(person[i].number,person[i+1].number);
- }
- counter--;
- system("cls");
- printf("\nA contact has been deleted.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement