Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ficheirolerclientes(listaclientes cliente){
- char linha[100];
- char nomecliente[100];
- char cc[100];
- FILE *fp;
- fp = fopen("viagens.txt", "r");
- if(fp == NULL){
- printf("Erro ao abrir ficheiro!(leitura)");
- return;
- }
- while(fgets(linha, 200, fp) != NULL){
- strcpy(nomecliente, strtok(linha, "-"));
- strcpy(cc, strtok(NULL, ";"));
- cliente->cc=atoi(cc);
- Insere_cliente_fim(cliente, nomecliente, cc);
- }
- fclose(fp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement