<?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[auf leeren array prüfen]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich prüfen ob ein array leer ist?<br />
In delphi sieht das ja so aus:<br />
a[n]=#0;</p>
<p>geht leider net.<br />
Was kann ich dann benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/164470/auf-leeren-array-prüfen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 21:44:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/164470.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Nov 2006 16:13:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:13:48 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich prüfen ob ein array leer ist?<br />
In delphi sieht das ja so aus:<br />
a[n]=#0;</p>
<p>geht leider net.<br />
Was kann ich dann benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171254</guid><dc:creator><![CDATA[rizor]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:13:48 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:18:55 GMT]]></title><description><![CDATA[<p>was genau meinst du mit leer?<br />
ich kann leider kein delphi, aber das sieht fast so aus, als wolltest du für jedes einzelne element des arrays prüfen, ob es 0 ist. ist vielleicht sinnvoll, wenn du ein array von zeigern hast, vielleicht weniger sinnvoll, wenn du mit einem array von ints arbeitest, um die temperaturen der letzten paar wochen zu speichern.</p>
<p>wenn du allerdings prüfen willst, ob ein array kein element beinhaltet, bräuchtest du was dynamisches, denn ein statisches array von sich aus enthält immer eine gewisse anzahl von elementen (die man auch nicht mehr ändern kann)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171257</guid><dc:creator><![CDATA[queer_boy]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:21:56 GMT]]></title><description><![CDATA[<p>genau, ich möchte prüfen, ob das array einen inhalt hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171260</guid><dc:creator><![CDATA[rizor]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:21:56 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:27:57 GMT]]></title><description><![CDATA[<p>Kommt drauf an, welches Array du nimmst. Wenn du es mit new erstellst, mußt du dich selbst darum kümmern, d.h., immer irgendwo festhalten, wie groß es gerade ist. Verwendest du std::vector, so kannst du mit der Methode size() die aktuelle Größe abfragen (und mit resize() verändern).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171269</guid><dc:creator><![CDATA[audacia]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:27:57 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:43:29 GMT]]></title><description><![CDATA[<p>Ich wollte das jetzt folgender maßen lösen.</p>
<pre><code class="language-cpp">while (t != 0)
{
   x = rand();
   if (x&lt;=9)
   {
       a[6] = x;
       ++t;
   }
}
</code></pre>
<p>Das Problem ist nur, dass x anscheinent ein maximaler integer-wert wird.<br />
Wieso?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171279</guid><dc:creator><![CDATA[rizor]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:43:29 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:47:54 GMT]]></title><description><![CDATA[<p>Ich sehe keinen Zusammenhang zwischen deinen Beiträgen.<br />
Was willst du denn nun machen?<br />
Überprüfen ob alle Elemente eines Feldes einen bestimmten Wert haben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171282</guid><dc:creator><![CDATA[Senfgurke]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:47:54 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:51:45 GMT]]></title><description><![CDATA[<p>Naja vorher wollte ich</p>
<pre><code class="language-cpp">while (t != 0)
{
   x = rand();
   if (x&lt;=9)
   {
       a[6] = x;
       ++t;
   }
}
</code></pre>
<p>mit Hilfe des arrays machen.<br />
Also schauen, ob das array schob bechrieben ist oder net.<br />
Das mit dem size etc. ist mir zu kompliziert und nun wollte ich es mit einer zweiten variable machen.<br />
Mit t denn, wenn ich das array beschreibe, zählt er t eins hoch und die schleife bricht ab.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171285</guid><dc:creator><![CDATA[rizor]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:51:45 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:55:36 GMT]]></title><description><![CDATA[<p>In deinem Quellcodebeispiel greifst du nur auf ein einziges Feldelement (a[6]) zu.</p>
<p>Ich verstehe deine Problem immernoch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171290</guid><dc:creator><![CDATA[Senfgurke]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:55:36 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:57:18 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39344.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39344.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171299</guid><dc:creator><![CDATA[Thomas ** 0]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:57:18 GMT</pubDate></item><item><title><![CDATA[Reply to auf leeren array prüfen on Wed, 08 Nov 2006 16:57:22 GMT]]></title><description><![CDATA[<p>Das wollte ich ja die ganze zeit tun.<br />
sorry, wenn ich mich oben nicht klar ausgedrückt habe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1171300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1171300</guid><dc:creator><![CDATA[rizor]]></dc:creator><pubDate>Wed, 08 Nov 2006 16:57:22 GMT</pubDate></item></channel></rss>