<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CAtlList und GetPrev&#x2F;GetNext]]></title><description><![CDATA[<p>Warum funktioniert folgendes</p>
<pre><code class="language-cpp">CAtlList&lt;int&gt; Zahlen;
Zahlen.AddHead(5);
.
.
.
Zahlen.AddHead(10); 

POSITION pos;
pos = Zahlen.GedHeadPosition();

while(pos != NULL)
{
   cout &lt;&lt; Zahlen.GetNext(pos);
}
</code></pre>
<p>aber wenn ich es ohne schleife schreiben will, geht es nicht</p>
<pre><code class="language-cpp">CAtlList&lt;int&gt; Zahlen;
Zahlen.AddHead(5);
.
.
.
Zahlen.AddHead(10); 
POSITION pos;
pos = Zahlen.GetHeadPosition();
cout &lt;&lt; Zahlen.GetNext(pos);
</code></pre>
<p>Ich brauche es eigentlich so, das ich mir immer vom letzten Element den Vorgönger brauche.<br />
Ich füge mit AddHead( ) hin zu und möchte dann einfach mit GetPrev das<br />
vorherige Element bekommen.<br />
Das sollte doch möglich sein, oder?</p>
<p>Grüße,<br />
milchmann</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192195/catllist-und-getprev-getnext</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 22:10:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192195.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Sep 2007 15:16:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CAtlList und GetPrev&#x2F;GetNext on Tue, 11 Sep 2007 15:16:10 GMT]]></title><description><![CDATA[<p>Warum funktioniert folgendes</p>
<pre><code class="language-cpp">CAtlList&lt;int&gt; Zahlen;
Zahlen.AddHead(5);
.
.
.
Zahlen.AddHead(10); 

POSITION pos;
pos = Zahlen.GedHeadPosition();

while(pos != NULL)
{
   cout &lt;&lt; Zahlen.GetNext(pos);
}
</code></pre>
<p>aber wenn ich es ohne schleife schreiben will, geht es nicht</p>
<pre><code class="language-cpp">CAtlList&lt;int&gt; Zahlen;
Zahlen.AddHead(5);
.
.
.
Zahlen.AddHead(10); 
POSITION pos;
pos = Zahlen.GetHeadPosition();
cout &lt;&lt; Zahlen.GetNext(pos);
</code></pre>
<p>Ich brauche es eigentlich so, das ich mir immer vom letzten Element den Vorgönger brauche.<br />
Ich füge mit AddHead( ) hin zu und möchte dann einfach mit GetPrev das<br />
vorherige Element bekommen.<br />
Das sollte doch möglich sein, oder?</p>
<p>Grüße,<br />
milchmann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363441</guid><dc:creator><![CDATA[unreguser]]></dc:creator><pubDate>Tue, 11 Sep 2007 15:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to CAtlList und GetPrev&#x2F;GetNext on Wed, 12 Sep 2007 06:18:15 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-2822.html" rel="nofollow">SideWinder</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-13.html" rel="nofollow">DOS und Win32-Konsole</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-1.html" rel="nofollow">MFC (Visual C++)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363774</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363774</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 12 Sep 2007 06:18:15 GMT</pubDate></item><item><title><![CDATA[Reply to CAtlList und GetPrev&#x2F;GetNext on Wed, 12 Sep 2007 08:19:12 GMT]]></title><description><![CDATA[<p>Ich verstehe nicht was Du möchtest und was nicht funktioniert.<br />
Du fügst immer am Kopf der Liste ein. Folgerichtig wird bei Deinem unteren Beispiel 10 ausgegeben.</p>
<p>Was erwartest Du?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363820</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 12 Sep 2007 08:19:12 GMT</pubDate></item><item><title><![CDATA[Reply to CAtlList und GetPrev&#x2F;GetNext on Thu, 13 Sep 2007 06:45:07 GMT]]></title><description><![CDATA[<p>Hallo.<br />
Ich möchte eigentlich immer das vorletzte eingefügte Element erhalten.<br />
Ich füge z.b. 1 2 3 4 5 ein. Wenn ich nun GetPrev aufrufe, will ich Element 4 erhalten. IRgendwie klappt das nicht mit den Listen.</p>
<pre><code class="language-cpp">CAtlList&lt;int&gt; list;
for(int c = c; c &lt; 10; &lt;++)
{
   list.AddHead(i);
}
POSITION position;
position = list.GetTailPosition();
cout &lt;&lt; list.GetPrev(pos);
</code></pre>
<p>Jetzt müsste ich doch so eingefügt haben<br />
0<br />
1 0<br />
2 1 0<br />
use. wobei 0 Tail ist, richtig ?<br />
Wenn ich mir nun mit GetTailPosition() die Position zurückgeben lasse und<br />
GetPrev aufrufe müsste doch theoretisch 1 herauskommen. Ich bekomme aber 0.</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364409</guid><dc:creator><![CDATA[unreguser]]></dc:creator><pubDate>Thu, 13 Sep 2007 06:45:07 GMT</pubDate></item><item><title><![CDATA[Reply to CAtlList und GetPrev&#x2F;GetNext on Thu, 13 Sep 2007 07:09:19 GMT]]></title><description><![CDATA[<p>unreguser schrieb:</p>
<blockquote>
<p>Jetzt müsste ich doch so eingefügt haben<br />
0<br />
1 0<br />
2 1 0<br />
use. wobei 0 Tail ist, richtig ?<br />
Wenn ich mir nun mit GetTailPosition() die Position zurückgeben lasse und<br />
GetPrev aufrufe müsste doch theoretisch 1 herauskommen. Ich bekomme aber 0.</p>
</blockquote>
<p>Wer liest hat mehr vom Programmieren! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /><br />
<a href="http://msdn2.microsoft.com/de-de/library/597w29w2(VS.80).aspx" rel="nofollow">http://msdn2.microsoft.com/de-de/library/597w29w2(VS.80).aspx</a><br />
CObList::GetPrev<br />
Gets the list element identified by rPosition, then sets rPosition to the POSITION value of the previous entry in the list.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1364418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1364418</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 13 Sep 2007 07:09:19 GMT</pubDate></item></channel></rss>