Programme.exe a cessé de fonctionner
Bonjour,
j'ai un programme que je compile sans erreurs et à l'exécution.
J'ai une fenêtre qui m'indique que mon programme.exe a cessé de fonctionner.
C'est là ou ça beugue.
dans mon fichier.cpp
tab=SommetsGroupe(Tete,i);
dans mon fichier.hpp
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| int* SommetsGroupe(Sommet *Tete,int i)
{
pCourant = Tete;
int j=0;
int indice;
int* SomGroupe = (int*) malloc(1 * sizeof(int*));
if(Tete==NULL)
{
printf("la liste des sommets est vide\n");
}
else
{
while (pCourant != NULL)
{
if((pCourant->indiceG)==i)
{
indice=pCourant->CGI;
SomGroupe[j]=indice;
j++;
}
pCourant = pCourant->pSuivant;
}
}
return(SomGroupe);
} |
Merci de votre aide