<?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[Stackprogrammierung push(const itemType&amp;amp;)]]></title><description><![CDATA[<p>Hallöchen!<br />
Wieder eine Noobfrage von mir <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Ich hab wieder so ne Aufgabe bekommen bei denen ich die Funktionsköpfe nicht ändern kann. Sowas ist mir noch nie über den Weg gelaufen.</p>
<pre><code>push(const itemType&amp;)
</code></pre>
<p>itemType kommt aus einem Template und definiert den Datentyp. Ich müsste an die Variable ran, die übergeben wird, wie macht man sowas?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/287523/stackprogrammierung-push-const-itemtype-amp</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 10:25:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/287523.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 May 2011 10:42:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:42:23 GMT]]></title><description><![CDATA[<p>Hallöchen!<br />
Wieder eine Noobfrage von mir <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Ich hab wieder so ne Aufgabe bekommen bei denen ich die Funktionsköpfe nicht ändern kann. Sowas ist mir noch nie über den Weg gelaufen.</p>
<pre><code>push(const itemType&amp;)
</code></pre>
<p>itemType kommt aus einem Template und definiert den Datentyp. Ich müsste an die Variable ran, die übergeben wird, wie macht man sowas?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070894</guid><dc:creator><![CDATA[benny111]]></dc:creator><pubDate>Mon, 30 May 2011 10:42:23 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:43:49 GMT]]></title><description><![CDATA[<p>Referenzen verfolgen unter der Haube das selbe Konzept wie Pointer, du musst sie allerdings nicht dereferenzieren und kannst sie wie eine normale Variable verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070895</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Mon, 30 May 2011 10:43:49 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:49:54 GMT]]></title><description><![CDATA[<p>also schreib ich:</p>
<pre><code>&lt;itemType&gt; neuevariable = const itemType&amp;
</code></pre>
<p>oder wie <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070899</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070899</guid><dc:creator><![CDATA[benny111]]></dc:creator><pubDate>Mon, 30 May 2011 10:49:54 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:52:58 GMT]]></title><description><![CDATA[<p>benny111 schrieb:</p>
<blockquote>
<p>Ich hab wieder so ne Aufgabe bekommen bei denen ich die Funktionsköpfe nicht ändern kann. Sowas ist mir noch nie über den Weg gelaufen.</p>
<pre><code>push(const itemType&amp;)
</code></pre>
</blockquote>
<p>Sieht der Funktionskopf wirklich so aus?<br />
1. &quot;const itemType&amp;&quot; ist durchaus zulässig, in der Implementierung der Funktion kannst du diesen um einen Variablennamen ergänzen (Ich sehe es aber als unsauberen Stil an, mit unbenannten Parametern im Header zu arbeiten, da ich den Header als die Einheit ansehe, in der man sich einen Überblick verschafft).<br />
2. Der fehlende Rückgabewert ist jedoch kein gültiger C++ Code! Einige Compiler lassen dies (In der Regel aber nicht bei der höchsten Warnstufe) zu, und nehmen dann häufig int als Rückgabewert an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070900</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Mon, 30 May 2011 10:52:58 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:54:21 GMT]]></title><description><![CDATA[<p>benny111 schrieb:</p>
<blockquote>
<p>also schreib ich:...</p>
</blockquote>
<p>Nein, die Funktionsimplementierung <strong>muss</strong> um einen Parametername ergänzt werden, zum Rest siehe mein letztes Post.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070902</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070902</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Mon, 30 May 2011 10:54:21 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:57:38 GMT]]></title><description><![CDATA[<p>tschuldige... da steht im header</p>
<pre><code>bool push(const itemType&amp;)
</code></pre>
<p>und ich darf den Header nicht erweitern... darf ich einfach nicht -.-<br />
gibts nicht irgendne möglichkeit trotzdem an die variable ran zu kommen, das ich den z.B. ausgeben kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070904</guid><dc:creator><![CDATA[benny111]]></dc:creator><pubDate>Mon, 30 May 2011 10:57:38 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 10:58:48 GMT]]></title><description><![CDATA[<p>benny111 schrieb:</p>
<blockquote>
<p>also schreib ich:</p>
<pre><code>&lt;itemType&gt; neuevariable = const itemType&amp;
</code></pre>
<p>oder wie <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
</blockquote>
<p>Ohne Name wird das natürlich nichts. Einen Namen hinzufügen steht dir im Übrigen frei, da du nicht die Funktionssignatur veränderst.</p>
<pre><code class="language-cpp">void foo(const bar&amp; var)
{
  std::cout &lt;&lt; var;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2070906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070906</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Mon, 30 May 2011 10:58:48 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 11:05:19 GMT]]></title><description><![CDATA[<p>Ethon schrieb:</p>
<blockquote>
<p>Einen Namen hinzufügen steht dir im Übrigen frei, da du nicht die Funktionssignatur veränderst.</p>
</blockquote>
<p>Ich hoffe meine Proffs sehn das auch so... ich machs einfach so <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="🙂"
    /><br />
Dankeschön für die Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070911</guid><dc:creator><![CDATA[benny111]]></dc:creator><pubDate>Mon, 30 May 2011 11:05:19 GMT</pubDate></item><item><title><![CDATA[Reply to Stackprogrammierung push(const itemType&amp;amp;) on Mon, 30 May 2011 11:23:56 GMT]]></title><description><![CDATA[<p>benny111 schrieb:</p>
<blockquote>
<p>Ich hoffe meine Proffs sehn das auch so... ich machs einfach so <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>
</blockquote>
<p>Du hast eh keine Alternative dazu.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2070918</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2070918</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Mon, 30 May 2011 11:23:56 GMT</pubDate></item></channel></rss>