Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1.  if (verifica_ficheiro(f) == 1) {
  2.         return NULL;
  3.     } else {
  4.         while (fscanf(f, "%d %f %d %d %49[^\n]", &aux.id, &aux.preco, &aux.valor, &aux.estado, aux.nome) == 5) {
  5.             (*tam)++;
  6.             temp = realloc(vetor, sizeof (Guitarra)*(*tam));
  7.             vetor = temp;
  8.             *(vetor + (*tam) - 1) = aux;
  9.         }
  10.     }
  11.     fclose(f);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement