<?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[Sinnvolle Variablen Deklaration]]></title><description><![CDATA[<p>Hallo ich hab mal eine Frage zur Variablen Deklaration.</p>
<p>Ist es so das wenn ich hier z.b. short auswahl; anstatt int auswahl; nehme<br />
das dass Programm dann weniger Leistung braucht?</p>
<p>short auswahl; = Wenig Leistung<br />
int auswahl; = Mehr Leistung</p>
<pre><code class="language-cpp">int auswahl;
cout&lt;&lt;&quot;1 = Programm Beenden , 2 = Fortfahren&quot;;
cin&gt;&gt;auswahl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/239987/sinnvolle-variablen-deklaration</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 05:30:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/239987.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Apr 2009 09:55:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sinnvolle Variablen Deklaration on Thu, 30 Apr 2009 09:55:52 GMT]]></title><description><![CDATA[<p>Hallo ich hab mal eine Frage zur Variablen Deklaration.</p>
<p>Ist es so das wenn ich hier z.b. short auswahl; anstatt int auswahl; nehme<br />
das dass Programm dann weniger Leistung braucht?</p>
<p>short auswahl; = Wenig Leistung<br />
int auswahl; = Mehr Leistung</p>
<pre><code class="language-cpp">int auswahl;
cout&lt;&lt;&quot;1 = Programm Beenden , 2 = Fortfahren&quot;;
cin&gt;&gt;auswahl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1703542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703542</guid><dc:creator><![CDATA[blup]]></dc:creator><pubDate>Thu, 30 Apr 2009 09:55:52 GMT</pubDate></item><item><title><![CDATA[Reply to Sinnvolle Variablen Deklaration on Thu, 30 Apr 2009 14:00:39 GMT]]></title><description><![CDATA[<p>weniger Speicher</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703645</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703645</guid><dc:creator><![CDATA[kitov]]></dc:creator><pubDate>Thu, 30 Apr 2009 14:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to Sinnvolle Variablen Deklaration on Thu, 30 Apr 2009 14:23:40 GMT]]></title><description><![CDATA[<p>du wirst keinen unterschied feststellen - vermutlich gibts auch keinen mehr, nachdem der compiler es optimiert hat...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703653</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703653</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 30 Apr 2009 14:23:40 GMT</pubDate></item><item><title><![CDATA[Reply to Sinnvolle Variablen Deklaration on Thu, 30 Apr 2009 14:41:17 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>vermutlich gibts auch keinen mehr, nachdem der compiler es optimiert hat...</p>
</blockquote>
<p>Warum sollte es nicht? zumindest der Wertebereich sollte kleiner sein bei short (gesetzt den Fall dass sizeof(short) &lt; sizeof(int)). Auch wenn der Compiler jetzt aus alignement-Gründen für den short trotzdem 4 byte auf dem Stack reserviert darf das den Wertebereich afaik nicht ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703661</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 30 Apr 2009 14:41:17 GMT</pubDate></item><item><title><![CDATA[Reply to Sinnvolle Variablen Deklaration on Thu, 30 Apr 2009 15:16:42 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>unskilled schrieb:</p>
<blockquote>
<p>vermutlich gibts auch keinen mehr, nachdem der compiler es optimiert hat...</p>
</blockquote>
<p>Warum sollte es nicht? zumindest der Wertebereich sollte kleiner sein bei short (gesetzt den Fall dass sizeof(short) &lt; sizeof(int)). Auch wenn der Compiler jetzt aus alignement-Gründen für den short trotzdem 4 byte auf dem Stack reserviert darf das den Wertebereich afaik nicht ändern.</p>
</blockquote>
<p>ja - den unterschied wird er aber nich bemerken - entweder, es wurd ne 1 oder ne 2 eingetippt oder was anderes...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703680</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 30 Apr 2009 15:16:42 GMT</pubDate></item><item><title><![CDATA[Reply to Sinnvolle Variablen Deklaration on Thu, 30 Apr 2009 15:35:18 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>ja - den unterschied wird er aber nich bemerken - entweder, es wurd ne 1 oder ne 2 eingetippt oder was anderes...</p>
</blockquote>
<p>Was passiert wenn ich ne Zahl eintippe die 1+std::numeric_limits&lt;unsigned short&gt;::max() entspricht? Als int dürfe dann eine entsprechend große Zahl dort stehen - als short könnte ich mir vorstellen dass ne 1 rauskommt.</p>
<p>/edit: bullshit <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="😉"
    /> bei zu großen zahlen wird der short nicht geändert sondern bei cin der errorflag-gesetzt...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1703688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1703688</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 30 Apr 2009 15:35:18 GMT</pubDate></item></channel></rss>