Passing argument... incompatible pointer type[enabld by default]

Résolu/Fermé
sabirab2 Messages postés 6 Date d'inscription vendredi 6 janvier 2012 Statut Membre Dernière intervention 17 février 2014 - 29 mai 2013 à 01:51
sabirab2 Messages postés 6 Date d'inscription vendredi 6 janvier 2012 Statut Membre Dernière intervention 17 février 2014 - 29 mai 2013 à 02:02
Bonjour chers Programmeurs,
Bref je sais pas d'où vient le problème Si vous pouvez m'aider
merciii d'avance

#include<stdio.h>
#include<stdlib.h>
//******************************* LA STRUCTURE de l'arbre ************************************
 typedef struct Arbre
{
    unsigned int key;
    struct node *gauche;
    struct node *droite;
}arbre ;

//******************************* Creation Noeud *****************
arbre * CreatNode(unsigned int val)
{   
    arbre *node =(arbre*)malloc(sizeof(arbre));
    node->key = val;
    node->gauche = NULL;
    node->droite = NULL;
}
//******************************* INSERTION *********************
arbre * ajoutNode(arbre *tree,arbre* node)
{
   
    if(tree==NULL) return node;
    if(node->key<tree->key)
        tree->gauche=ajoutNode(tree->gauche,node );
    else
        tree->droite=ajoutNode(tree->droite,node);
    return tree;
}
//**************************** MAIN() ******************************
main()
{
    arbre  *A=NULL,*N_node=CreatNode(10);
    ajoutNode(A,N_node);
}


Les erreurs :
attention : passing argument 1 of 'ajoutNode' from incompatible pointer type [enabled by default]
note: expected 'struct arbre *' but argument is of type 'struct node *'
: attention : assignment from incompatible pointer type [enabled by default]
attention : passing argument 1 of 'ajoutNode' from incompatible pointer type [enabled by default]
note: expected 'struct arbre *' but argument is of type 'struct node *'
: attention : assignment from incompatible pointer type [enabled by default]

1 réponse

sabirab2 Messages postés 6 Date d'inscription vendredi 6 janvier 2012 Statut Membre Dernière intervention 17 février 2014
29 mai 2013 à 02:02
j'ai trouvé d'ou vient le prblm faut mettre 'struct arbre * au lieu de 'struct node *
mercii
0