Spero di essere d'aiuto, prova a buttare un'occhio su questo codice:


Codice Sbagliato

Codice PHP:
int inserisci (struct scheda *tint valchar *nomechar *cogn)

struct scheda *p;
p=(struct scheda *)malloc(sizeof(struct scheda));

if (
p==NULL) return (ERRORE);

p->codice=val;
p->nome=strdup(nome);

if (
p->nome==NULL) return (ERRORE);

p->cognome=strdup(cognome);

if (
p->cognome==NULL) return (ERRORE);

p->succ=t;
t=p;
return (
OK);



Codice Corretto

Codice PHP:
int inserisci (struct scheda **tint valchar *nomechar *cogn)

struct scheda *p;

p=(struct scheda *)malloc(sizeof(struct scheda));

if (
p==NULL) return (ERRORE);

p->codice=val;
p->nome=strdup(nome);

if (
p->nome==NULL) return (ERRORE);

p->cognome=strdup(cognome);

if (
p->cognome==NULL) return (ERRORE);

p->succ=*t;
*
t=p;
return (
OK);

Programma Chiamante

Codice PHP:
ret=inserisci (&testavalnomecognome); 
Fammi sapere!!