ok grazie ma non ho capito molto ...
comunque mi da errore qui:
codice:
struct ListCount *buildListCount(struct List lis){
Ma devo sostituire tutto il mio codice dove definisco la mia lista con quello che hai postato tu? oppure devo implementare le due porzioni di codice?
Perchè nel mio prg successivamente nel main (), aggiungo elementi nella lista mediante una cosa del genere:
codice:
struct List *head = NULL;
struct List *temp = NULL;
while(fgets(s,254,FileIn))
{
if (strstr (s, par) != NULL)
{
if(head == NULL){
head = (struct List *)malloc (sizeof(struct List));
init(head, s);
}
else
add(head, s);
temp = head;
y++;
}
else
x++;
}
while(temp != NULL)
{
printf("%s\n", temp ->el);
temp = temp ->next;
}
c = -1;
fclose(FileIn);
}
QUALCUNO RIESCE A SCHIARIRMI UN PO LE IDEE?
grazie
ciao