Si qqun est encore vivant....

casers Messages postés 49 Statut Membre -  
casers Messages postés 49 Statut Membre -
Bonjour,
noeud *NouveauNoeud(noeud *papa,StructClient *Client)
{
noeud *N;
char*p;

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

N = (noeud*) malloc(sizeof (noeud));
N->FilsDroite = (noeud*) malloc(sizeof (noeud));
N->FilsGauche = (noeud*) malloc(sizeof (noeud));
N->pere = (noeud*) malloc(sizeof (noeud));
N->couleur = (int*) malloc(sizeof(ROUGE));

printf("%s\n", "Creation d'un nouveau noeud:");
printf("%s->%s\n"," Code",Client->CodeClient);
printf("%s->%s\n"," Nom",Client->NomClient);
printf("%s->%s\n"," MotDePasse",Client->MDP);
printf("%s->%s\n"," Solde",Client->SoldeCompteClient);

//************************************************************************************
// ce print m'affiche que l'adresse de Client->NomClient et N->couleur est la meme...*
//************************************************************************************

N->InfoClient->CodeClient = (char*) malloc(strlen (Client->CodeClient)+1);
N->InfoClient->MDP = (char*) malloc(strlen(Client->MDP)+1);
N->InfoClient->NomClient = (char*) malloc(strlen(Client->NomClient)+1);
N->InfoClient->SoldeCompteClient = (char*) malloc(strlen(Client->SoldeCompteClient)+1);

N->FilsGauche = NULL;
N->FilsDroite = NULL;
N->pere = papa;
*N->couleur = ROUGE;// Le noeud inseré est initialement toujours de couleur rouge.

strcpy(N->InfoClient->CodeClient , Client->CodeClient);
strcpy(N->InfoClient->NomClient , Client->NomClient);
strcpy(N->InfoClient->MDP , Client->MDP);
strcpy(N->InfoClient->SoldeCompteClient , Client->SoldeCompteClient);gets(p);

return N;
}

Cette ligne fait tout bugger...purquoi??

Cpadawan

1 réponse

casers Messages postés 49 Statut Membre
 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.

Put*** !!!!!! sa fai une heure que jme fai chier et je ne l'ai simplement pas initialisé.......heureusement y fai froid et les fenetres sont fermées...
0