<?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[Unterschied Array mit einem Element &#x2F; Variable]]></title><description><![CDATA[<p>Hallo zusammen,<br />
gibt es hier zwischen einen Unterschied?</p>
<pre><code class="language-cpp">double x[1] = {5};
double y    = 5;
</code></pre>
<p>Vielen Dank<br />
lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/270916/unterschied-array-mit-einem-element-variable</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 18:02:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/270916.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Jul 2010 10:17:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 10:17:42 GMT]]></title><description><![CDATA[<p>Hallo zusammen,<br />
gibt es hier zwischen einen Unterschied?</p>
<pre><code class="language-cpp">double x[1] = {5};
double y    = 5;
</code></pre>
<p>Vielen Dank<br />
lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929054</guid><dc:creator><![CDATA[freakC++]]></dc:creator><pubDate>Tue, 20 Jul 2010 10:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 10:24:57 GMT]]></title><description><![CDATA[<p>freakC++ schrieb:</p>
<blockquote>
<p>Hallo zusammen,<br />
gibt es hier zwischen einen Unterschied?</p>
<pre><code class="language-cpp">double x[1] = {5};
double y    = 5;
</code></pre>
<p>Vielen Dank<br />
lg, freakC++</p>
</blockquote>
<p>Semantisch ist beides das gleiche. Syntaktisch hast Du aber einen gewaltigen Unterschied.</p>
<p>mfg Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929058</guid><dc:creator><![CDATA[mgaeckler]]></dc:creator><pubDate>Tue, 20 Jul 2010 10:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 15:18:20 GMT]]></title><description><![CDATA[<p>In wiefern meinst du Unterschied?</p>
<p>Das sind grundsätzlich ganz verschiedene Sachen. <code>x</code> ist ein Array mit nur einem Element vom Typ <code>double</code> und y ist ein <code>double</code> .</p>
<p>Unterschiede gibt es sehr viele. Zu nennen sind das Verhalten bei Funktionsüberladungen, Zugriff oder z.b auch das Verhalten, wenn du die Variablen versuchst zu inkrementieren. Ich sehe da nicht viele parallelen, ausser, dass sie beide gleich viel Speicher (mit dem gleichen Typen) brauchen. Aber das hier tut das auch:</p>
<pre><code class="language-cpp">struct foo{ double x; };
</code></pre>
<p>Und das ist auch nicht wirklich gleich, wie die gezeigten Beispiele..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929225</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929225</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 20 Jul 2010 15:18:20 GMT</pubDate></item><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 15:24:14 GMT]]></title><description><![CDATA[<p>freakC++ schrieb:</p>
<blockquote>
<p>Hallo zusammen,<br />
gibt es hier zwischen einen Unterschied?</p>
<pre><code class="language-cpp">double x[1] = {5};
double y    = 5;
</code></pre>
</blockquote>
<p>Der Typ und der Zugriff ist offensichtlich unterschiedlich. Aber ja, Du kannst im Prinzip alle lokalen &quot;normalen&quot; Variablen durch 1-elementige Arrays ersetzten und dementsprechend überall ein [0] dranhängen. Das sollte mehr oder weniger zum gleichen Maschinencode führen.</p>
<p>kk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929228</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Tue, 20 Jul 2010 15:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 16:21:42 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ja, ich meinte eher, ob es auf Maschinenebene einen Unterschied gibt. Dass ersteres ein Array ist, war mir klar :D. Drakons Beispiel mit dem struct ist aber auch ein gutes Beispiel.</p>
<p>Herzlichen Dank<br />
lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929265</guid><dc:creator><![CDATA[freakC++]]></dc:creator><pubDate>Tue, 20 Jul 2010 16:21:42 GMT</pubDate></item><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 16:24:25 GMT]]></title><description><![CDATA[<p>freakC++ schrieb:</p>
<blockquote>
<p>Hallo,<br />
ja, ich meinte eher, ob es auf Maschinenebene einen Unterschied gibt.</p>
</blockquote>
<p>In optimiertem Zustand kaum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929267</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 20 Jul 2010 16:24:25 GMT</pubDate></item><item><title><![CDATA[Reply to Unterschied Array mit einem Element &#x2F; Variable on Tue, 20 Jul 2010 16:35:06 GMT]]></title><description><![CDATA[<p>Ok, super!</p>
<p>Bis dann<br />
lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1929271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1929271</guid><dc:creator><![CDATA[freakC++]]></dc:creator><pubDate>Tue, 20 Jul 2010 16:35:06 GMT</pubDate></item></channel></rss>