how to delete data and add from file in c language
#include <stdio.h>
#include <stdlib.h>
void Menu();
void New_Staff();
void Delete_Staff();
void Export_Profile();
struct element{
char id[20];
char name[20];
char gender[20];
char phone[20];
char email[20];
}profile;
int main(void){ //The program will continue running until option 4 selected
int a;
for(a=0;;a++){
Menu();
}
return 0;
}
void Menu() //Main Menu to select option
{
int n;
printf("n**********************************************");
printf("nMAIN MENU-STAFF INFORMATION SYSTEM");
printf("n**********************************************");
printf("n1. Add profile Staff Profile");
printf("n2. Delete Staff Profile");
printf("n3. Export All Profiles to 'output.txt'");
printf("n4. Exit");
printf("n**********************************************");
printf("nPlease enter your option< 1 / 2 / 3 / 4 >: ");
scanf("%d", &n);
switch(n){
case 1:
New_Staff();
break;
case 2:
Delete_Staff();
break;
case 3:
Export_Profile();
break;
case 4:
printf("n*** Thanks for using the program! Goodbye. ***");
exit(0);
break;
default:
printf("nError! Wrong Number is EnterednPlease Try Again");
break;
}
}
void New_Staff() //Add New Staff Profile
{
int x;
struct element profile;
printf("n===Add New Staff Profile===");
printf("nnPlease enter the following staff information.");
printf("nnStaff ID: ");
scanf("%s", &profile.id);
printf("Namet: ");
fflush(stdin);
fgets(profile.name,20,stdin);
for(x=0 ; x<20 ; x++)
{
if(profile.name[x] == 'n')
profile.name[x] = '