A me verrebbe in mente una cosa del genere ma è sicuramente sbagliato il ciclo while.
codice:
void inserisci_nastro()
{
FILE *f1, *f2;
Bagaglio var1;
Nastro var2;
int num_n;
char ch;
long pos;
if((f1=fopen("Bagagli.txt","rb"))!=NULL)
{
if((f2=fopen("Nastri.txt","ab"))!=NULL)
{
while((fread(&var1, sizeof(Bagaglio),1,f1))!=feof(f1))
{
pos= ftell(f1) - sizeof(Bagaglio);
fseek(f1, pos, SEEK_SET);
fwrite(&var2, sizeof(Nastro), 1, f2);
printf("Inserisci numero nastro restituzione\n");
scanf("%d", &num_n);
fprintf(f2,"numero nastro: %d", &num_n);
fflush(stdin);
/* printf("Inserisci informazione di consegna del bagaglio %s\n", &var2.codice_v);
scanf("%s", ch);
fprintf(f2,"*INFO*: %s", ch);
fflush(stdin);*/
}
}
else printf("Errore\n");
}
else printf("Errore\n");
fclose(f1);
fclose(f2);
}