<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Printing linked List in Reverse without Reversing The List Actually</title>
	<link>http://www.openasthra.com/c-tidbits/printing-linked-list-in-reverse-without-reversing-the-list-actually/</link>
	<description>C/C++ Programming Blog</description>
	<pubDate>Fri, 21 Nov 2008 23:15:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Alek</title>
		<link>http://www.openasthra.com/c-tidbits/printing-linked-list-in-reverse-without-reversing-the-list-actually/#comment-27251</link>
		<dc:creator>Alek</dc:creator>
		<pubDate>Tue, 12 Aug 2008 23:56:01 +0000</pubDate>
		<guid>http://www.openasthra.com/c-tidbits/printing-linked-list-in-reverse-without-reversing-the-list-actually/#comment-27251</guid>
		<description>wouldn't the stack version not print the last element in the list but would instead start with the second to last since, 

tmpnode = Pop(stack); 
//here tmpnode is the last node
 
  while(tmpnode)
  {
    tmpnode = Pop(stack);
    // now tempnode is the 2nd to last node
    printf("%d -&#62; ", tmpnode-&#62;info);
  }

to fix this just add a printf("%d -&#62; ", tmpnode-&#62;info); before the while loop

right?</description>
		<content:encoded><![CDATA[<p>wouldn&#8217;t the stack version not print the last element in the list but would instead start with the second to last since, </p>
<p>tmpnode = Pop(stack);<br />
//here tmpnode is the last node</p>
<p>  while(tmpnode)<br />
  {<br />
    tmpnode = Pop(stack);<br />
    // now tempnode is the 2nd to last node<br />
    printf(&#8221;%d -&gt; &#8220;, tmpnode-&gt;info);<br />
  }</p>
<p>to fix this just add a printf(&#8221;%d -&gt; &#8220;, tmpnode-&gt;info); before the while loop</p>
<p>right?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
