Hi Alessandro, Your question is off-topic for this forum. This forum is for GCC specific questions, not general C questions. Anyway, to answer your question: I think you have one or more bugs in your code. In you main, just to start with, you have: lista l; lista is a pointer. You have not allocated your the struct to which your pointer points to, yet you immediately set l->next and l->prev to NULL. Since l does not point to anything (i.e., it's a wild pointer or a null pointer), I'm slightly surprised your program doesn't crash sooner. There may be other bugs as well. I didn't check further. HTH, --Eljay