<?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[Inhalt eines Arrays löschen ?]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann mir jemand von Euch verraten, wie man den kompletten Inhalt eines Arrays löscht bzw. zurücksetzt?</p>
<p>Mein Programm soll bei Bedarf des Benutzers ohne beendet zu werden immer wieder vom Anfang gestartet werden können, nur funktioniert es dann nicht, weil die arrays noch mit Inhalten gefüllt sind.</p>
<p>MfG<br />
Carsten</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/176286/inhalt-eines-arrays-löschen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 12:18:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/176286.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Mar 2007 17:19:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 17:19:04 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann mir jemand von Euch verraten, wie man den kompletten Inhalt eines Arrays löscht bzw. zurücksetzt?</p>
<p>Mein Programm soll bei Bedarf des Benutzers ohne beendet zu werden immer wieder vom Anfang gestartet werden können, nur funktioniert es dann nicht, weil die arrays noch mit Inhalten gefüllt sind.</p>
<p>MfG<br />
Carsten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248591</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248591</guid><dc:creator><![CDATA[CarstenH]]></dc:creator><pubDate>Mon, 19 Mar 2007 17:19:04 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 17:44:14 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Jedes Element einzeln je nach Typ zurücksetzen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248614</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 19 Mar 2007 17:44:14 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 17:58:26 GMT]]></title><description><![CDATA[<p>und wie setzt man zurück ?</p>
<p>while(i&lt;strlen(&amp;array[0]))<br />
{<br />
array[i]=0;<br />
i++;<br />
}</p>
<p>dann hab ich doch alles voller nullen stehen !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248629</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248629</guid><dc:creator><![CDATA[CarstenH]]></dc:creator><pubDate>Mon, 19 Mar 2007 17:58:26 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 18:31:41 GMT]]></title><description><![CDATA[<p>strlen(namen)</p>
<p>int array[10] = {0};</p>
<p>while(i&lt;10){<br />
array[i] = 0;<br />
i++;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248648</guid><dc:creator><![CDATA[Stelfer]]></dc:creator><pubDate>Mon, 19 Mar 2007 18:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 18:32:43 GMT]]></title><description><![CDATA[<p>Und was willst du haben? Ganz leer geht ja nicht, irgendwas ist an der Adresse ja immer, lauter Nullen sind ja letztendlich &quot;nichts&quot;, oder irre ich mich da?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248652</guid><dc:creator><![CDATA[uekue]]></dc:creator><pubDate>Mon, 19 Mar 2007 18:32:43 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 18:32:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ja das setzt alles auf 0 zurück. Ich würde zwar lieber std::vector&lt;int&gt; und desen Methode assign verwenden.<br />
Da du uns aber auch nicht sagt was für dich zurücksetzen heißt können wir dir auch nichts präziseres antworten.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248653</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248653</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 19 Mar 2007 18:32:49 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 18:56:33 GMT]]></title><description><![CDATA[<p>irgendeinen wert hatten die array element zuvor ja auch schon. du könntest tatsächlich vector&lt;int&gt; verwenden, der lässt sich auch recht komfortabel leerräumen aber wenn der schleifendurchlauf (oder was auch immer) nur dann funktioniert wenn die elemente zuvor einen bestimmten wert haben dann speicher den doch zuvor mal ab und weise allen elementen dannach in einer for schleife diesen wert wieder zu.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248667</guid><dc:creator><![CDATA[larz]]></dc:creator><pubDate>Mon, 19 Mar 2007 18:56:33 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 19:07:59 GMT]]></title><description><![CDATA[<p>Vektoren...kann ich nicht <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>
<p>habs nu hinbekommen...</p>
<p>einfach die escape sequenz &quot;Null character&quot; verwenden:</p>
<p>array[i]='\0';</p>
<p>trotzdem Danke für die Vorschläge <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>
<p>MfG<br />
Carsten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248676</guid><dc:creator><![CDATA[CarstenH]]></dc:creator><pubDate>Mon, 19 Mar 2007 19:07:59 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt eines Arrays löschen ? on Mon, 19 Mar 2007 19:14:06 GMT]]></title><description><![CDATA[<p>Also:</p>
<pre><code class="language-cpp">char array[10];
for(int i = 0; i &lt; 10; ++i)
    array[i] = 0; // Nicht zu verwechseln mit '0'

// imho äquivalent zu:
char array[10];
for(int i = 0; i &lt; 10; ++i)
    array[i] = '\0';
</code></pre>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248691</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Mon, 19 Mar 2007 19:14:06 GMT</pubDate></item></channel></rss>