<?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[Neues Listenelement, mit Nummer als Namensmembervariable, erstellen]]></title><description><![CDATA[<p>In &quot;class warehouse {&quot; erstelle ich die Liste<br />
&quot;public: list&lt;Department&gt; m_departments;};&quot;,<br />
welche Elemente von &quot;class Department<br />
{public: int m_number; Product* m_pproduct;};&quot; enthält.</p>
<p>Nachdem ich in der Mainfunktion<br />
&quot;Department empty_department;&quot; definiert,<br />
&quot;empty_department.m_number = 1;&quot; zugewiesen und<br />
&quot;m_departments.push_back(empty_department);&quot; anfügt habe, ist &quot;empty_department.m_number==1&quot; wahr.<br />
&quot;(*m_departments.end()).m_number==0&quot; aber leider auch.</p>
<p>Weshalb funktioniert die Zuweisung nicht ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/325275/neues-listenelement-mit-nummer-als-namensmembervariable-erstellen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 19:57:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/325275.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Apr 2014 19:56:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Neues Listenelement, mit Nummer als Namensmembervariable, erstellen on Wed, 23 Apr 2014 19:56:49 GMT]]></title><description><![CDATA[<p>In &quot;class warehouse {&quot; erstelle ich die Liste<br />
&quot;public: list&lt;Department&gt; m_departments;};&quot;,<br />
welche Elemente von &quot;class Department<br />
{public: int m_number; Product* m_pproduct;};&quot; enthält.</p>
<p>Nachdem ich in der Mainfunktion<br />
&quot;Department empty_department;&quot; definiert,<br />
&quot;empty_department.m_number = 1;&quot; zugewiesen und<br />
&quot;m_departments.push_back(empty_department);&quot; anfügt habe, ist &quot;empty_department.m_number==1&quot; wahr.<br />
&quot;(*m_departments.end()).m_number==0&quot; aber leider auch.</p>
<p>Weshalb funktioniert die Zuweisung nicht ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2396032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2396032</guid><dc:creator><![CDATA[fuse]]></dc:creator><pubDate>Wed, 23 Apr 2014 19:56:49 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Listenelement, mit Nummer als Namensmembervariable, erstellen on Wed, 23 Apr 2014 20:30:25 GMT]]></title><description><![CDATA[<p>Der end-Iterator von praktisch jedem Container, bezieht sich nicht auf ein gueltiges Element. Man kann es sich eher so vorstellen (bei vielen Containern ist das sogar wortwoertlich so), dass er hinter das letzte Element zeigt<sup>*</sup>.</p>
<p><sup>*</sup>: <a href="http://stackoverflow.com/questions/9963401/why-are-standard-iterator-ranges-begin-end-instead-of-begin-end" rel="nofollow">Dieses Design hat auch einen tieferen Sinn</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2396038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2396038</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 23 Apr 2014 20:30:25 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Listenelement, mit Nummer als Namensmembervariable, erstellen on Wed, 23 Apr 2014 20:55:00 GMT]]></title><description><![CDATA[<p>Nach (*(m_departments.end()-1)).m_number + 1; bekomme ich folgendes zurück:<br />
E2094 'operator-' ist im Typ '_List_iterator&lt;Department,_Nonconst_traits&lt;Department&gt; &gt;' für Argumente des Typs 'int' nicht implementiert</p>
<p>Gibt es eine andere Möglichkeit um auf das letzte Element der Liste zuzugreifen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2396040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2396040</guid><dc:creator><![CDATA[fuse]]></dc:creator><pubDate>Wed, 23 Apr 2014 20:55:00 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Listenelement, mit Nummer als Namensmembervariable, erstellen on Wed, 23 Apr 2014 21:00:14 GMT]]></title><description><![CDATA[<p>1. m_departments.back()<br />
2. Wozu list?<br />
3. Warum UN?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2396041</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2396041</guid><dc:creator><![CDATA[aufzählung]]></dc:creator><pubDate>Wed, 23 Apr 2014 21:00:14 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Listenelement, mit Nummer als Namensmembervariable, erstellen on Wed, 23 Apr 2014 21:45:27 GMT]]></title><description><![CDATA[<p>Sicher gibt es noch andere Möglichkeiten.<br />
Mit &quot;m_departments.back()&quot; funktioniert es<br />
und ich bedanke mich für die Hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2396045</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2396045</guid><dc:creator><![CDATA[fuse]]></dc:creator><pubDate>Wed, 23 Apr 2014 21:45:27 GMT</pubDate></item></channel></rss>