Salut
j´a un problem avec fread en fait en utilise des liste
chainer e on aimerai les sauvegardes dans un fichier
pour les retrouver on utilise fwrite et ça marche (on
retrouve nos structure en cripter dans le fichier)
mais quan j´utilise fread ça marche pas ça me met des
chiane vide
voici la structure:
typedef struct tache { int annee, mois, jours, heured,
minuted, heuref, minutef; char sujet[8]; struct tache
- precedent; struct tache * suivant;}tache_t;
tache_t *premier;
voici la fonction qui affiche
void affiche2()
{
//printf("\nliste : \n");
tache_t * debut;
debut=(tache_t *)malloc(sizeof(tache_t));
fread(debut,sizeof(tache_t),Nb_index,Fp_index);
printf("Lundi %c%c Mardi %c%c Mercredi %c%c
Jeudi %c%c Vendredi %c%c Samedi %c%c Dimanche
%c%c\n",tab[0],tab[1],tab[3],tab[4],tab[6],tab[7],
tab[9],tab[10],tab[12],tab[13],tab[15],tab[16],tab
[18],tab[19]);
printf("\n");
while(debut!=NULL)
{
printf("%dh:",debut->heured);
printf("%s\n ",debut->sujet);
debut=debut->suivant;
}
printf("\n");
}
merci de votre aide