<?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[Deklarationen]]></title><description><![CDATA[<p>Hallo! <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 />
Bin noch Anfänger auf niedrigem Niveau und beschäftige mich theoretisch gerade mit arrays!<br />
Was passiert eigtl. bei folgenden Arrays Deklarationen?</p>
<p>a) short array[4] = { 1, 2 };</p>
<p>b) char str = &quot;a&quot;;</p>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29394" /><label for="checkbox29394">= &quot;hello world&quot;;</label></div></p>
<p>d) float value[ ];</p>
<p>e) unsigned int buffer[3] = { 13, 707, 0, 3000 };</p>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29395" /><label for="checkbox29395">= { { 1.0, 0.0 }, { -1.0, 0.5 } };</label></div></p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/301418/deklarationen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 03:37:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/301418.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Mar 2012 20:21:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Deklarationen on Mon, 26 Mar 2012 20:21:30 GMT]]></title><description><![CDATA[<p>Hallo! <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 />
Bin noch Anfänger auf niedrigem Niveau und beschäftige mich theoretisch gerade mit arrays!<br />
Was passiert eigtl. bei folgenden Arrays Deklarationen?</p>
<p>a) short array[4] = { 1, 2 };</p>
<p>b) char str = &quot;a&quot;;</p>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29394" /><label for="checkbox29394">= &quot;hello world&quot;;</label></div></p>
<p>d) float value[ ];</p>
<p>e) unsigned int buffer[3] = { 13, 707, 0, 3000 };</p>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29395" /><label for="checkbox29395">= { { 1.0, 0.0 }, { -1.0, 0.5 } };</label></div></p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195717</guid><dc:creator><![CDATA[gustlbert]]></dc:creator><pubDate>Mon, 26 Mar 2012 20:21:30 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Mon, 26 Mar 2012 20:36:28 GMT]]></title><description><![CDATA[<p>gustlbert schrieb:</p>
<blockquote>
<p>a) short array[4] = { 1, 2 };</p>
</blockquote>
<p>array hat den Inhalt 1;2;0;0</p>
<blockquote>
<p>b) char str = &quot;a&quot;;</p>
</blockquote>
<p>Das geht nicht. Einem char kannst du kein const char[2] zuweisen.</p>
<blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29396" /><label for="checkbox29396">= &quot;hello world&quot;;</label></div></p>
</blockquote>
<p>hello ist ein char[12] und hat den Inhalt &quot;hello world\n&quot;</p>
<blockquote>
<p>d) float value[ ];</p>
</blockquote>
<p>Das geht nicht. Die Größe muss bekannt sein.</p>
<blockquote>
<p>e) unsigned int buffer[3] = { 13, 707, 0, 3000 };</p>
</blockquote>
<p>Das geht nicht. Die Anzahl der Werte muss kleinergleich der Arraygröße sein.</p>
<blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29397" /><label for="checkbox29397">= { { 1.0, 0.0 }, { -1.0, 0.5 } };</label></div></p>
</blockquote>
<p>Das geht nicht. table als mehrdimensionales Array muss alle Dimensionen außer der ersten fix haben.</p>
<p>P.S.: Anfänger auf niedrigem Niveau und schon solche Schweinereien machen? Bringt man std::array und std::vector gar nicht mehr bei?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195722</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 26 Mar 2012 20:36:28 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Mon, 26 Mar 2012 20:37:10 GMT]]></title><description><![CDATA[<p>&quot;Was passiert&quot; ist eine relativ ungenaue Frage. Zudem sind das nicht nur Deklarationen, sondern vor allem auch Definitionen. (<a href="http://www.c-plusplus.net/forum/301387-10" rel="nofollow">Wenn wir schon mal dabei sind.</a> ;))</p>
<p>gustlbert schrieb:</p>
<blockquote>
<p>a) short array[4] = { 1, 2 };</p>
</blockquote>
<p>Definiert ein Array aus vier short Variablen, wobei die das erste Element mit 1, das zweite mit 2 und die anderen mit 0 initialisiert werden.</p>
<p>gustlbert schrieb:</p>
<blockquote>
<p>b) char str = &quot;a&quot;;</p>
</blockquote>
<p>Ungültig. char ist <strong>ein</strong> Zeichen, &quot;a&quot; ist vom Typ const char[2].</p>
<p>gustlbert schrieb:</p>
<blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29398" /><label for="checkbox29398">= &quot;hello world&quot;;</label></div></p>
</blockquote>
<p>Ein Array aus 12 char wird mit einem const char[12] initialisiert, die Werte werden kopiert.</p>
<p>gustlbert schrieb:</p>
<blockquote>
<p>d) float value[ ];</p>
</blockquote>
<p>Ungültig.</p>
<p>gustlbert schrieb:</p>
<blockquote>
<p>e) unsigned int buffer[3] = { 13, 707, 0, 3000 };</p>
</blockquote>
<p>Keine gute Idee.</p>
<p>gustlbert schrieb:</p>
<blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29399" /><label for="checkbox29399">= { { 1.0, 0.0 }, { -1.0, 0.5 } };</label></div></p>
</blockquote>
<p>Ungültig, nur die äußere Größe kann automatisch bestimmt werden.</p>
<p>Edit:<br />
omg, 3 Minuten zu spät.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195724</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Mon, 26 Mar 2012 20:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Mon, 26 Mar 2012 20:46:32 GMT]]></title><description><![CDATA[<p>cooky451 schrieb:</p>
<blockquote>
<p>gustlbert schrieb:</p>
<blockquote>
<p>e) unsigned int buffer[3] = { 13, 707, 0, 3000 };</p>
</blockquote>
<p>Keine gute Idee.</p>
</blockquote>
<p>Nicht nur keine Gute Idee.<br />
Ungültig, Syntaxfehler.</p>
<p>Edit: HUST, Eig. 7 Minuten zu spät, hat SeppJ schon geschrieben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195725</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 20:46:32 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Mon, 26 Mar 2012 22:20:31 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox29400" /><label for="checkbox29400">= &quot;hello world&quot;;</label></div></p>
</blockquote>
<p>hello ist ein char[12] und hat den Inhalt &quot;hello world**\n**&quot;</p>
</blockquote>
<p>&quot;hello world**\0**&quot;</p>
<p>Und seit wann machen wir hier Hausaufgaben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195737</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 26 Mar 2012 22:20:31 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Mon, 26 Mar 2012 22:26:52 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<p>Und seit wann machen wir hier Hausaufgaben?</p>
</blockquote>
<p>Seitdem wir froh sind, dass Fragen in ordentlichem Deutsch und mehr oder weniger klar gestellt werden; ohne dabei gleich die eingescannte Aufgabenstellung anzuhängen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195738</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Mon, 26 Mar 2012 22:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Tue, 27 Mar 2012 05:15:05 GMT]]></title><description><![CDATA[<p>cooky451 schrieb:</p>
<blockquote>
<p>hustbaer schrieb:</p>
<blockquote>
<p>Und seit wann machen wir hier Hausaufgaben?</p>
</blockquote>
<p>Seitdem wir froh sind, dass Fragen in ordentlichem Deutsch und mehr oder weniger klar gestellt werden; ohne dabei gleich die eingescannte Aufgabenstellung anzuhängen.</p>
</blockquote>
<p>Naja, so richtig viel Mühe hat sich der TE auch nicht gegeben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195746</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 27 Mar 2012 05:15:05 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Tue, 27 Mar 2012 06:37:02 GMT]]></title><description><![CDATA[<p>gustlbert schrieb:</p>
<blockquote>
<p>Was passiert eigtl. bei folgenden Arrays Deklarationen?</p>
</blockquote>
<p>Da es noch keiner angemerkt hat: Es sind allesamt keine Deklarationen sondern Definitionen. Oder zumindest Versuche, etwas zu definieren <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195759</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 27 Mar 2012 06:37:02 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Tue, 27 Mar 2012 06:42:35 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>Da es noch keiner angemerkt hat: Es sind allesamt keine Deklarationen sondern Definitionen.</p>
</blockquote>
<p>Es wurde schonmal angemerkt, da war es auch noch teilweise richtig. Aber dass es &quot;keine Deklarationen&quot; seien ist einfach Quatsch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195761</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Tue, 27 Mar 2012 06:42:35 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Tue, 27 Mar 2012 08:13:19 GMT]]></title><description><![CDATA[<p>Bashar schrieb:</p>
<blockquote>
<p>pumuckl schrieb:</p>
<blockquote>
<p>Da es noch keiner angemerkt hat: Es sind allesamt keine Deklarationen sondern Definitionen.</p>
</blockquote>
<p>Es wurde schonmal angemerkt, da war es auch noch teilweise richtig. Aber dass es &quot;keine Deklarationen&quot; seien ist einfach Quatsch.</p>
</blockquote>
<p>Sind das nicht Initialisierungen, die eine Definition implizieren die wiederum eine Deklaration impliziert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195773</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 27 Mar 2012 08:13:19 GMT</pubDate></item><item><title><![CDATA[Reply to Deklarationen on Tue, 27 Mar 2012 08:49:53 GMT]]></title><description><![CDATA[<p>Bashar schrieb:</p>
<blockquote>
<p>Es wurde schonmal angemerkt, da war es auch noch teilweise richtig. Aber dass es &quot;keine Deklarationen&quot; seien ist einfach Quatsch.</p>
</blockquote>
<p>Ok, sorry, mein dicker Patzer. Erstens cookies Post nicht zu Ende gelesen, zweitens blöd formuliert. Natürlich beinhaltet eine Definition immer auch eine Deklaration.</p>
<p>Hacker schrieb:</p>
<blockquote>
<p>Sind das nicht Initialisierungen, die eine Definition implizieren die wiederum eine Deklaration impliziert?</p>
</blockquote>
<p>Es gibt keine alleinstehenden Initialisierungen - in den meisten Fällen sind es aber tatsächlich Definitionen mit (expliziter) Initialisierung, abgesehen von Fall d), wo keine Initialisierung vorliegt. Bei alledem sei natürlich außen vorgelassen, dass ungültiger Code ungültiger Code bleibt und deshalb weder eine Deklaration, noch eine Definition oder sonstwas sein kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195776</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 27 Mar 2012 08:49:53 GMT</pubDate></item></channel></rss>