Merci je vois le probleme, mais je ne sais pas le résoudre . J'ai un probleme avec les structutres et les pointeurs (enfaite les pointeurs dans les structures je supporte pas)
du coup si je change ca en passant les pointeur nom et gen directement en variable(voir




) , mais du coup *(pcour->Nom)=temp1;*(pcour->gen)=temp2; est faux ? (voir ;




)
ou alors je peux essayé d'alloue nom en le laissant en pointeur : voir plus bas
NOEUD*Nom=NULL;








Nom= (char*)malloc(sizeof(char));







///////////////////////////////////************************************/////////////////////////////////////////////////////#include <stdio.h>
#include <stdlib.h>
#include<string.h>
typedef struct NOEUD
{
char Nom[10];







int gen;









struct NOEUD *pere;
struct NOEUD *ptg;
struct NOEUD *ptd;
}NOEUD;
main()
{
FILE *pfichier;
pfichier=fopen("arbre.txt","r");
//il faut ouvrir le fichier ds la fct,c mieux
char temp1[10];
int temp2;
int temp3;
int i;
struct NOEUD *pcour;
while(!feof(pfichier))
{
fscanf(pfichier,"%s %d",&temp1,&temp2);
//on fait des enfants par generation ptg
NOEUD*ptg=NULL;
ptg= (NOEUD*)malloc(sizeof(NOEUD));
*(pcour->Nom)=temp1;




*(pcour->gen)=temp2;





pcour->ptg=ptg;
pcour=ptg;
}
}
///////////////////////////////////************************************/////////////////////////////////////////////////////ou alors je peux essayé d'alloue nom en le laissant en pointeur :
typedef struct NOEUD
{
char *Nom;
int *gen;
struct NOEUD *pere;
struct NOEUD *ptg;
struct NOEUD *ptd;
}NOEUD;
main()
{
FILE *pfichier;
pfichier=fopen("arbre.txt","r");
//il faut ouvrir le fichier ds la fct,c mieux
char temp1[10];
int temp2;
int temp3;
int i;
struct NOEUD *pcour;
while(!feof(pfichier))
{
fscanf(pfichier,"%s %d",&temp1,&temp2);
//on fait des enfants par generation ptg
NOEUD*ptg=NULL;
ptg= (NOEUD*)malloc(sizeof(NOEUD));
NOEUD*Nom=NULL;








Nom= (char*)malloc(sizeof(char));








(pcour->Nom)=&temp1;
(pcour->gen)=&temp2;
pcour->ptg=ptg;
pcour=ptg;
}
}
Merci encore d'anvance