Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void EscreverFicheiro(FILE * ptr,LISTA dados){
- ptr = fopen("listagem","wb");
- system("cls");
- printf("nttPOR FAVOR INSIRA SEUS DADOSnn");
- printf("ttNOME: ");
- fflush(stdin);
- gets(dados.nome);
- printf("ttRUA: ");
- fflush(stdin);
- gets(dados.rua);
- printf("ttCIDADE: ");
- fflush(stdin);
- gets(dados.cidade);
- printf("ttPROVINCIA: ");
- fflush(stdin);
- gets(dados.provincia);
- printf("ttCOD POSTAL: ");
- fflush(stdin);
- gets(dados.codpost);
- fflush(stdin);
- fwrite(&dados,sizeof(struct lista_type),1,ptr);
- fclose(ptr);
- }
- fseek(stdin, 0, SEEK_END);
- while (getchar() != 'n');
Add Comment
Please, Sign In to add comment