struct linked * reverse(){
struct linked *current = first, *temp, *newfirst = NULL;
while(current){
temp = current->next;
current->next = newfirst;
newfirst = current;
current = temp;
}
return newfirst;
}
il nome della struttura è linked . first è una variabile globale alla testa. L'ultimo elemento ha next che punta a NULL.
Ogni elemento punta al successivo con *next appunto.