Sorry it was not very clear......with the delete function below which is meant to be delete a record it deletes every record in the file.
void delete_site(struct location site[MAX], int i)
{
printf("\nYou have reached the delete_site funtion\n\n");
char name[20];
int j;
FILE*file;
printf("Please enter the name of the record you would like to delete:\n");
scanf("%s", name);
for(j=0;j<MAX;j++)
{
if((strcmp(name, site[j].name)==0))
{
printf("You have deleted the record for %s", site[j].name);
site[j].name[0] = '\0';
}
}
if(j>=MAX)
{
printf("\nThis site does not exist\n");
}
file = fopen ("sites.txt", "w");
for(j=0;j<=MAX;j++)
fprintf (file,"%s\n",site[j].name);
fclose(file);
}