Secondo me è tutto sbagliato, posto il codice che penso sia corretto:
codice:
struct cella
{
int valore;
struct cella *next;
};
void CercaMax(struct cella **elenco, int *max);
int main(void)
{
struct cella *elenco = NULL;
int valore;
/*... Manca l'allocazione della lista ...*/
CercaMax(&elenco, &valore);
return 0;
}
void CercaMax(struct cella **elenco, int *max)
{
struct cella *temp = *elenco;
int i = *max = 0;
for(i = 0; i < MAX_LISTE; i++)
{
do
{
if((temp->valore) > *max)
{
*max = temp->valore;
}
temp = temp->next;
}
while(temp != elenco[i]);
}
}