Bonjour,
je dois faire une procedure qui doit renvoyer un tableau. Voici ce que j'ai ecrit:
dans le .h
int* retournerTableau(void);
dans le .cpp
int* Graphe::retournerTableau(void)
{
int i,j;
int res[nbNoeuds][nbNoeuds];
for(i=0;i<nbNoeuds;i++)
{
for(j=0;j<nbNoeuds;j++)
res[i][j] = 0;
}
return res;
}
Graphes.cpp: In member function 'int* Graphe::retournerTableau()':
Graphes.cpp:144: error: cannot convert 'int (*)[(((unsigned
int)(((int)((Graphe*)this)->Graphe::nbNoeuds) - 1)) + 1u)]' to
'int*' in return
make: *** [main.o] Error 1