Sorry for such easy question, this is part of my assignment and I'm stuck. As you can see 

```
#include <stdio.h>

int main (void){

FILE *menu;
FILE *update;
FILE *updatewrite;  
menu = fopen("menu.txt","w");

char selection,name[10],updateid,dump ; 
int mealnum,i,j,id,price ;

start:  

scanf("%c%c",&selection,&dump); 

if (selection =='r'){

printf ("Enter the number of meals to be entered\n");
scanf("%d",&mealnum);   

    for(i=0;i<mealnum;i++){
        printf("Enter the name of me1al\n");
        scanf("%s",&name);
        printf("Enter the ID of meal\n");   
        scanf("%d",&id);
        printf("Enter the Price of meal\n");
        scanf("%d",&price);
        fprintf(menu,"%s %d %d\n",name,id,price);
        }
        fclose(menu);
        }

else if(selection =='u'){

update = fopen("menu.txt","r");

int count=0;
while(fscanf(update,"%s %d %d\n",name,&mealnum,&price) != EOF){
printf("Update %s %d %d?\n Y to update any other key for next",name,mealnum,price);
scanf("%c",updateid);
count++;
break;  
}

printf("Enter the new name of meal\n");
scanf("%s",name);
printf("Enter the new ID of meal\n");   
scanf("%d",&id);
printf("Enter the new Price of meal\n");
scanf("%d",&price);

fclose(update);

updatewrite = fopen("/home/mbp/menu.txt","w+"); 

for(j=0;j<count;j++){fscanf(updatewrite,"%s %d %d\n",name,mealnum,price);} //trying to move buffer to proper overwriting location by looping one less times

fprintf(updatewrite,"%s %d %d\n",name,mealnum,price);

fclose(updatewrite);}

else if(selection =='d'){}
else if(selection =='s'){}
else if(selection =='b'){}
else if(selection =='q'){
    return 0;
}
else{printf ("Not VALID!");}
goto start;

return 0; }

```

Nothing other than fscanf, fprintf is accepted.

Thanks for any help. 

EDIT: full code updated, assigment changed, single file needs to replaced, I'm not allowed use a second file.