Hmm I see.
But I must ave messed something up because it doesn't create file on write either.
My writting function is
Code:
int guardaLista()
{
FILE *ficheiro = fopen(nome, "wb");
int cnt = -1;
No* auxiliar = cabeca;
if (ficheiro != NULL)
{
for (;auxiliar!=NULL; auxiliar=auxiliar->proximo)
cnt = fwrite( auxiliar->restaurante, sizeof(Restaurante), 1, ficheiro);
fclose(ficheiro);
}
else{
printf("O ficheiro n existe.\n");
}
return cnt; /* número de elementos escritos ou -1 */
}
I can give you the structs if you want but I'm guessing it's probably some newbie mistake I can't see.