/* * CS5600 University of Utah * Charles McGarvey * mcgarvey@eng.utah.edu */ #include "list.h" void list_reverse(list_t** l) { list_t* p = *l; list_t* n = p->link; p->link = NULL; while (n) { list_t* t = n->link; n->link = p; p = n; n = t; } *l = p; }