Grazie!
Paola
- Codice:
if ((fileout=fopen(file, "r"))!=NULL)
label:
printf("\nIl file non è vuoto. Sovrascrivere? (y/n)");
scanf(" %c", &risposta);
fileout=fopen(file,"w");
if (risposta=='y')
fseek(fileout, 0, SEEK_SET);
else
{if (risposta=='n')
{
fseek(fileout, 0, SEEK_END);
}
if(risposta!='n' && risposta!='y')
{
printf("\nErrore!\n");
goto label;
}
}