I have this struct of people:
struct patient{
char name[100];
char address[100];
int age;
}
struct patient p1;
int f;
f = open("patients.dat",O_RDWR,S_IRUSR|S_IWUSR);
And I wrote a binary file by using f = open... and write(f,&p1,sizeof(struct patient))
Now there is a task where I have to delete certain people from the binary file (for example those whose name I enter) I thought about changing the last person with the one I wanna delete, but then there is still the last one in the file to be deleted.
Is there any way to delete that from the file, I don't know, like changing the p1's name,address,and age to '\0', but it didn't work, it still shows "ghost" things.