ajuda - procurar e mostrar

sdvferreira

Power Member
viva pessoal, alguém sabe como posso contornar este problema : tenho que procurar no ficheiro um nome e depois mostrar...

código:

void mostra_Utente(char *nome){
char temp;
utente *uLido;
FILE *f;

f=fopen("utente.dat","rb");
uLido =(utente *)malloc( sizeof(utente) );
while(fread(uLido,sizeof(struct cliente),1,f)!=NULL){

if (uLido.nome==nome)
{
diz_Utente(uLido); // procurar o gajo
}

uLido->seg= (utente *)malloc( sizeof(utente) );
uLido=uLido->seg;
}
uLido->seg=NULL;
getchar();
fclose(f);

}
 
struct cliente{
char nome[255];
int dNascimento[255];
char sexo;
char morada[255];
int codigoPostal;
char email[255];
int telf;
int bi;
char historia[2048];
struct cliente *seg;
};
typedef struct cliente utente ;
 
Back
Topo