Juin Posted January 5, 2010 at 07:20 PM Report Share #304283 Posted January 5, 2010 at 07:20 PM Tenho estas funçoes int LerFicheiro(Livro files[], char* nomef){ FILE *fon; int i=0; fon=fopen(nomef,"r"); if (fon==NULL){ printf("O Ficheiro nao existe!\n"); return 0; } while (!feof(fon)) { files[i]=LerPropostasDoFicheiro(fon); i++; } fclose(fon); return i; } Livro LerPropostasDoFicheiro(FILE *f){ int i; Livro dados; fscanf(f,"%[^;]%*c", dados.requisitante); fscanf(f,"%[^;]%*c", dados.coleccao); fscanf(f,"%[^;]%*c", dados.editor); fscanf(f,"%f%*c", &dados.preco); fscanf(f,"%d\n", &dados.NumDeExemplares); fscanf(f,"%[^;]%*c", dados.EndEditor); fscanf(f,"%[^;]%*c", dados.titulo); fscanf(f,"%[^;]%*c", dados.urgencia); fscanf(f,"%d\n", &dados.ISBN); for(i=0; i < dados.Qautores; i++) fscanf(f,"%[^;]%*c", dados.autores[i]); fscanf(f,"%d\n", &dados.dia); fscanf(f,"%d\n", &dados.mes); fscanf(f,"%d\n", &dados.ano); fscanf(f,"%d\n", &dados.diapub); fscanf(f,"%d\n", &dados.mespub); fscanf(f,"%d\n", &dados.anopub); fscanf(f,"%d\n", &dados.chave); return dados; } depois quando chamo o Lerfunçoes no main int main(){ char op; Livro a[DIM]; int index; index = LerFicheiro(a, "basededados.txt"); if (index!=0) printf("Dados carregados do ficheiro!\n"); system("pause"); system("cls"); Abertura(); op=Selecionar(); não chama as seguintes funçoes.... Link to comment Share on other sites More sharing options...
Juin Posted January 5, 2010 at 07:21 PM Author Report Share #304284 Posted January 5, 2010 at 07:21 PM o resultado é como nao tiesse nada tipo int main(){ return 0; } Link to comment Share on other sites More sharing options...
Juin Posted January 5, 2010 at 09:08 PM Author Report Share #304340 Posted January 5, 2010 at 09:08 PM alguem ajuda? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now