Jump to content

Singly-linked list/Reversal: Difference between revisions

m
imported>StraightDoubt
(Added a routine for the language C.)
imported>StraightDoubt
Line 49:
== C ==
This code works by reversing the pointers in the list. The function returns the new beginning of the list, or NULL if passed a null pointer.
 
<syntaxhighlight lang="C">
 
#include <stdlib.h>
Line 67 ⟶ 70:
return prev;
}
 
</syntaxhighlight>
 
=={{header|Delphi}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.