J'ai un petit bout de code qui me génère toujours une erreur de segmentationJe n'arrive pas à voir le pb.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 if (neighbor->id == header->src) { struct ID_REQUEST* id_req = (struct ID_REQUEST*)malloc(sizeof(ID_REQUEST)); id_req->Entier=nodedata->seq; id_req->suivant = NULL; if (neighbor->id_req == NULL){ neighbor->id_req = id_req; printf ("\n hello1 \n"); } else { printf ("\n hello2 \n"); struct ID_REQUEST* temp=neighbor->id_req; while(temp->suivant != NULL) { temp = temp->suivant; } temp->suivant = id_req; }
Merci d'avantage
Partager