<?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[[LinkedList] Was stimmt an meinem Knoten nicht?]]></title><description><![CDATA[<p>Hi Forum,</p>
<p>ich will für eine Adressverwaltung eine einfach verkette Liste erzeugen.<br />
Der Gedanke ist ja soweit ganz gut, nur verstehe ich nicht weshalb mir VC<br />
den folgenden Knoten nicht abnimmt:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;myAdresses.h&quot;
#include &quot;Node.h&quot;
</code></pre>
<pre><code class="language-cpp">class Node  
{
public:
    Node();
    Node(Object e);
    Node(Object e, Node n);
    virtual ~Node();

    Object content;
    Node nextNode;
};
</code></pre>
<p>VC++ meint dazu:<br />
nexpected 'class Node ('<br />
error C2238: unexpected token(s) preceding ';'<br />
error C2629: unexpected 'class Node ('<br />
error C2238: unexpected token(s) preceding ';'<br />
error C2146: syntax error : missing ';' before identifier 'content'<br />
error C2501: 'Object' : missing storage-class or type specifiers<br />
error C2501: 'content' : missing storage-class or type specifiers<br />
error C2460: 'nextNode' : uses 'Node', which is being defined [...] see definition...</p>
<p>Das ich &quot;Object&quot; so nicht benutzen kann ist klar (soll ein CObject werden), aber<br />
was mache ich sonst noch falsch?</p>
<p>Danke im Voraus,<br />
Khadgar</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/6488/linkedlist-was-stimmt-an-meinem-knoten-nicht</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 08:45:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/6488.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Jul 2003 20:34:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [LinkedList] Was stimmt an meinem Knoten nicht? on Sun, 06 Jul 2003 20:34:00 GMT]]></title><description><![CDATA[<p>Hi Forum,</p>
<p>ich will für eine Adressverwaltung eine einfach verkette Liste erzeugen.<br />
Der Gedanke ist ja soweit ganz gut, nur verstehe ich nicht weshalb mir VC<br />
den folgenden Knoten nicht abnimmt:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;myAdresses.h&quot;
#include &quot;Node.h&quot;
</code></pre>
<pre><code class="language-cpp">class Node  
{
public:
    Node();
    Node(Object e);
    Node(Object e, Node n);
    virtual ~Node();

    Object content;
    Node nextNode;
};
</code></pre>
<p>VC++ meint dazu:<br />
nexpected 'class Node ('<br />
error C2238: unexpected token(s) preceding ';'<br />
error C2629: unexpected 'class Node ('<br />
error C2238: unexpected token(s) preceding ';'<br />
error C2146: syntax error : missing ';' before identifier 'content'<br />
error C2501: 'Object' : missing storage-class or type specifiers<br />
error C2501: 'content' : missing storage-class or type specifiers<br />
error C2460: 'nextNode' : uses 'Node', which is being defined [...] see definition...</p>
<p>Das ich &quot;Object&quot; so nicht benutzen kann ist klar (soll ein CObject werden), aber<br />
was mache ich sonst noch falsch?</p>
<p>Danke im Voraus,<br />
Khadgar</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31524</guid><dc:creator><![CDATA[Khadgar]]></dc:creator><pubDate>Sun, 06 Jul 2003 20:34:00 GMT</pubDate></item><item><title><![CDATA[Reply to [LinkedList] Was stimmt an meinem Knoten nicht? on Sun, 06 Jul 2003 20:41:00 GMT]]></title><description><![CDATA[<p>Ok, mittlerweile siehts wie folgt aus und ich hab ihn auf zwei Fehler runter:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;myAdresses.h&quot;
#include &quot;Node.h&quot;
</code></pre>
<pre><code class="language-cpp">class Node 
{
public:
    Node();
    Node(CObject e);
    Node(CObject e, Node n);
    virtual ~Node();

    CObject content;
    Node nextNode;
};
</code></pre>
<p>Jetzt beschwert VC sich folgendermaßen:<br />
error C2460: 'nextNode' : uses 'Node', which is being defined [...] see declaration of 'Node'<br />
error C2248: 'CObject::CObject' : cannot access protected member declared in class 'CObject' [..] see declaration of 'CObject::CObject'</p>
<p>Kann mir dazu jemand was sagen?</p>
<p>Danke,<br />
Khadgar</p>
<p>[edit] Fehler im Source ausgebessert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> [/edit]</p>
<p>[ Dieser Beitrag wurde am 06.07.2003 um 22:43 Uhr von <strong>Khadgar</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31525</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31525</guid><dc:creator><![CDATA[Khadgar]]></dc:creator><pubDate>Sun, 06 Jul 2003 20:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to [LinkedList] Was stimmt an meinem Knoten nicht? on Mon, 07 Jul 2003 06:44:00 GMT]]></title><description><![CDATA[<p>Zu 1.<br />
VC liest, wie du dir denken kannst, von oben nach unten, stellt also fest, dass ein neues Objekt Node definiert wird, liest weiter und stellt fest, dass das Objekt sich selber verlangt, ohne dass es fertig definiert wurde. Somit konnte die Grösse des Objekts nicht festgestellt werden und die Kompilierung bricht ab.<br />
-&gt; Umgehen mit Zeiger auf Node</p>
<p>Zu 2.<br />
CObject ist ein Basisobjekt, welches ohne 'Drumherum' nicht existieren kann. Daher wird schon während der Kompilierung darauf geachtet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31526</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 07 Jul 2003 06:44:00 GMT</pubDate></item><item><title><![CDATA[Reply to [LinkedList] Was stimmt an meinem Knoten nicht? on Mon, 07 Jul 2003 06:48:00 GMT]]></title><description><![CDATA[<p>Du solltest dir mal Templates anschauen. Dein Code sieht irgendwie wie Java-Code aus. :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31527</guid><dc:creator><![CDATA[Schlange]]></dc:creator><pubDate>Mon, 07 Jul 2003 06:48:00 GMT</pubDate></item><item><title><![CDATA[Reply to [LinkedList] Was stimmt an meinem Knoten nicht? on Mon, 07 Jul 2003 13:11:00 GMT]]></title><description><![CDATA[<p>@&lt;Schlange&gt;:<br />
Drei Jahre &quot;Java&quot;-LK haben mich wohl deutlich gezeichnet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Aber ich gelobe Besserung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/31528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31528</guid><dc:creator><![CDATA[Khadgar]]></dc:creator><pubDate>Mon, 07 Jul 2003 13:11:00 GMT</pubDate></item></channel></rss>