 <p>As you want to avoid recursion, you need to reverse the list first. I see some attempt in the original code but it doesn't look correct. Try the following:</p> <pre><code>node *current = head; if (current != NULL) { node *prev = NULL; for (node *next = current-&gt;next; ; next = (current = next)-&gt;next) { current-&gt;next = prev; prev = current; if (next == NULL) break; } } </code></pre> <p>Then <code>current</code> will point to the head of the list and you can traverse using the <code>next</code> link over the list. Note that it will modify your original list but this is expected as I understood the original requirement.</p>