I have been working on this project that displays a binary tree in its real shape and to to do
that I am trying to copy the entire tree into a spacial liked list where i keep information about each node its value ,is it a leave or not ?,what is its level ..in order to print it conveniently
but the problem is that i cant copy the value of a node into the liked list's node
i tried to use another variable but it just wont work
here is a sample of the code :
void const_llc_arbre(noeud *racine,maillon**tete,int *cpt,maillon **q)
{
maillon *p;(node)(the node of the linked list)
allouer(&p);
int valeur;(value)
valeur=racine->info;(node->value)
p->val=valeur;
p->suiv=NULL;
p->niv=profondeur(racine);(the level of the node)
if(*cpt==0){*tete=p;}(head of liked list)
else
{
(*q)->suiv=p;(next)
}
*q=p;
(*cpt)++;
const_llc_arbre(racine->fd,&(*tete),&(*cpt),&(*q));(right son)
const_llc_arbre(racine->fg,&(*tete),&(*cpt),&(*q));(left son)
}