Anysse
Messages postés29Date d'inscriptionmercredi 27 octobre 2004StatutMembreDernière intervention17 août 2007
-
21 oct. 2005 à 23:47
mezaya
Messages postés202Date d'inscriptiondimanche 18 mai 2003StatutMembreDernière intervention 6 mars 2010
-
22 oct. 2005 à 00:37
Salut, alors voila, je code sous DevC++ 4.9.9.0
C'est mon premier programme utilisant les Listes chainees, et je n 'arrive pas a comprendre pourquoi il veut pas compiler
le programme suivant :
main()
{
int x;
typedef struct ListeC
{
int nb;
struct ListC *suivant;
};
struct ListeC depart, *noeud;
depart.suivant=NULL;
noeud=&depart;
printf("entrez un nombre\n");
do
{
scanf("%d",&x);
noeud->suivant=(struct ListeC *)malloc(sizeof(struct ListeC)); // ligne 26
noeud=noeud->suivant; // ligne 27
noeud->nb=x;
noeud->suivant=NULL;
printf("\appuyer sur e pour entrer un autre nombre sinon vous allez sortir\n");
}while (getch()=='e');
system("PAUSE");
}
Il affiche les erreurs suivantes :
-ligne 26 :cannot convert `main()::ListeC*' to ` main()::ListC*' in assignment
-ligne 27 :cannot convert `main()::ListC*' to ` main()::ListeC*' in assignment
Voila merci d'avance pour votre aide
Le bonheur ne serait-il pas un mot inventé un jour d'ennui ?