Guest User

Untitled

a guest
Jan 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. void EscreverFicheiro(FILE * ptr,LISTA dados){
  2.  
  3. ptr = fopen("listagem","wb");
  4. system("cls");
  5. printf("nttPOR FAVOR INSIRA SEUS DADOSnn");
  6. printf("ttNOME: ");
  7. fflush(stdin);
  8. gets(dados.nome);
  9. printf("ttRUA: ");
  10. fflush(stdin);
  11. gets(dados.rua);
  12. printf("ttCIDADE: ");
  13. fflush(stdin);
  14. gets(dados.cidade);
  15. printf("ttPROVINCIA: ");
  16. fflush(stdin);
  17. gets(dados.provincia);
  18. printf("ttCOD POSTAL: ");
  19. fflush(stdin);
  20. gets(dados.codpost);
  21. fflush(stdin);
  22. fwrite(&dados,sizeof(struct lista_type),1,ptr);
  23.  
  24. fclose(ptr);
  25. }
  26.  
  27. fseek(stdin, 0, SEEK_END);
  28.  
  29. while (getchar() != 'n');
Add Comment
Please, Sign In to add comment