<?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[maximale anzahl an array elemente]]></title><description><![CDATA[<p>hallo.<br />
<div class="plugin-markdown"><input type="checkbox" id="checkbox25529" checked="true" /><label for="checkbox25529">höchstens haben? Wenn das von pc zu pc unterschiedlich ist, kann ich dann irgend hierfür eine Konstante eintragen welche die maximale anzahl an dem jeweiligen pc entspricht oder wie kann ich diese abfragen? Danke</label></div></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/224279/maximale-anzahl-an-array-elemente</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 17:33:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/224279.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Oct 2008 20:07:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:07:59 GMT]]></title><description><![CDATA[<p>hallo.<br />
<div class="plugin-markdown"><input type="checkbox" id="checkbox25529" checked="true" /><label for="checkbox25529">höchstens haben? Wenn das von pc zu pc unterschiedlich ist, kann ich dann irgend hierfür eine Konstante eintragen welche die maximale anzahl an dem jeweiligen pc entspricht oder wie kann ich diese abfragen? Danke</label></div></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595105</guid><dc:creator><![CDATA[arrayuser400]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:07:59 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:14:58 GMT]]></title><description><![CDATA[<p>Die Grösse statischer Arrays hängt normalerweise von der Stackgrösse ab und ist system-/compilerabhängig.</p>
<p>Klingt mir aber nicht nach einer sinnvollen Anwendung. Wieso willst du die maximale Grösse kennen? So etwas brauchst du nicht wirklich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595111</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:14:58 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:18:44 GMT]]></title><description><![CDATA[<p>Im Prinzip ist es so, ja. Doch bevor ein Array derart &quot;überfüllt&quot; ist, wird das Programm vorher noch abstürzen. Es gibt daher keine &quot;Grenze&quot;.</p>
<blockquote>
<p>kann ich dann irgend hierfür eine Konstante eintragen</p>
</blockquote>
<p>Jo, klar, kannst alles machen:</p>
<pre><code class="language-cpp">const char *array=NULL;
array=new char[45];
</code></pre>
<p>Dem array wurden jetzt 45 Elemente hinzugefügt. Wenn du das array<br />
deklarierst, solltest du stets darauf achten, dass es auf keinen leeren<br />
Speicher zeigt. Da die Speicheradresse ziemlich hoch werden können<br />
(Mach das mal und lass Windows 1 Woche lang laufen). Deswegen hab ich<br />
sie hier mit NULL, also keinem Inhalt oder Adresse auf irgenetwas<br />
zufälliges deklariert. Achja, falls du &quot;new&quot; noch nicht kennst, dass<br />
reserviert neuen Speicher im RAM. Bzw. zeigt er für &quot;array&quot; an eine<br />
genaue Adresse über die der Speicher reserviert wird. Deswegen auch<br />
der Zeiger vom Datentyp &quot;char&quot; bei der Deklaration weil er einen Wert<br />
zurückliefert und zwar die Speicheradresse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595113</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595113</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:18:07 GMT]]></title><description><![CDATA[<p>arrayuser400 schrieb:</p>
<blockquote>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox25527" checked="true" /><label for="checkbox25527">höchstens haben?...</label></div></p>
</blockquote>
<p>Höchstens soviele, wie size_t (ist plattformabhängig) adressieren kann. In der Praxis ist aber viel früher Schluss, je nach Stackgrößeneinstellung des Compilers oder Heapgröße, die das Betriebssystem dem Prozess zugesteht oder ... oder ...</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595117</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:18:07 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:36:00 GMT]]></title><description><![CDATA[<p>way schrieb:</p>
<blockquote>
<p>Im Prinzip ist es so, ja. Doch bevor ein Array derart &quot;überfüllt&quot; ist, wird das Programm vorher noch abstürzen. Es gibt daher keine &quot;Grenze&quot;.</p>
</blockquote>
<p>Es geht hierbei nicht um wirkliche Arrays, wie sie der Threadersteller beschrieben hat, sondern um mehrere Elemente, die hintereinander im Speicher liegen (dynamische Arrays). Bei statischen Arrays erhält man bereits eine Compilerfehlermeldung, wenn die Dimension zu gross ist.</p>
<p>Ausserdem muss auch bei dynamischer Speicheranforderung nicht zwingend das Programm abstürzen, es wird einfach immer mehr Arbeitsspeicher angefordert, und irgendwann wird die Auslagerungsdatei angenagt und der Computer wird ziemlich langsam...</p>
<p>way schrieb:</p>
<blockquote>
<pre><code class="language-cpp">const char *array=NULL;
array=new char[45];
</code></pre>
<p>[...] Wenn du das array<br />
deklarierst, solltest du stets darauf achten, dass es auf keinen leeren<br />
Speicher zeigt. [...] Deswegen hab ich<br />
sie hier mit NULL, also keinem Inhalt oder Adresse auf irgenetwas<br />
zufälliges deklariert.</p>
</blockquote>
<p>Das ist aber ziemlich unnötig, wenn man es gleich in der nächsten Zeile belegt. Man sollte aber auch darauf achten, den Speicher wieder freizugeben.</p>
<p>P.S.: Es gibt nicht umsonst einen automatischen Zeilenumbruch. <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/1595124</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595124</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:36:00 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:39:54 GMT]]></title><description><![CDATA[<p>Also mein Code sieht so aus:</p>
<pre><code class="language-cpp">char Keybuff[10], controlField[99999];
	while(1)
	{
		strcpy(Keybuff, &quot;/0&quot;);
		recv(s2, Keybuff, sizeof(Keybuff), 0);
		strcat(controlField, Keybuff);
		SetDlgItemText(hwndDialog[2], IDC_EDIT1, controlField);
	}
</code></pre>
<p>immer wenn was empfangen wird, dann wird es Keybuff zugewießen und dann in controlfield &quot;getcatted&quot;. Ich kann Keybuff nicht direkt angeben, weil es immer den Text vom letzten durchgang auch noch anzeigen soll. Wie würdet ihr das umschreiben damit es besser klappt? Ich habe halt angst, dass controlField irgendwann platzt wenn das programm lange läuft. Für code wäre ich dankbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595126</guid><dc:creator><![CDATA[arrayuser400]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:42:43 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12954">@Nexus</a><br />
Lag auch in meiner Meinung, dass die Definition außerhalb der Deklarierung<br />
liegt (:. Ahyo, hab ich wohl im Eifer des Gefechts vergessen:<br />
Spädder wenn du die Elemente durchgelauft hast und due das Programm beendest,<br />
geb die Elemente noch Frei bzw, lösche sie, und zwar so:</p>
<pre><code class="language-cpp">delete[] array;
</code></pre>
<p><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/1595131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595131</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:42:43 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:42:56 GMT]]></title><description><![CDATA[<p><a href="http://de.wikipedia.org/wiki/Liste_(Datenstruktur)" rel="nofollow">http://de.wikipedia.org/wiki/Liste_(Datenstruktur)</a><br />
oder<br />
schau dir mal die STL an...<br />
z.B. Vector</p>
<p>Ist es das was du suchst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595132</guid><dc:creator><![CDATA[Speedy_92]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:42:56 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 20:46:56 GMT]]></title><description><![CDATA[<p>@arrayuser<br />
Wo liegt das Problem? Ich weiss, dass ich vor Graumer Zeit mal eine heftige<br />
Acces Vialation hatte, dass heisst, die Elementenanzahl war zu Hoch. Kann<br />
mich an 9999 erinnern, schraub deine Zahl doch mal runter. Und achja,<br />
warum reservierst du den Speicher nicht einfach nach der Menge, du bekommst<br />
sie doch rein? &quot;99999&quot; ist sogesehen der sichere Tod deines Programmes...(:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/2915">@Speedy</a><br />
Lösch dein Beitrag lieber, dass hat rein garnichts hiermmit zu tun!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595135</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Tue, 07 Oct 2008 20:46:56 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Tue, 07 Oct 2008 23:27:20 GMT]]></title><description><![CDATA[<p>way schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/2915">@Speedy</a><br />
Lösch dein Beitrag lieber, dass hat rein garnichts hiermmit zu tun!</p>
</blockquote>
<p>Nein Speedy, lass dein Beitrag stehen <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/1595200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595200</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 07 Oct 2008 23:27:20 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 11:32:34 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">char Keybuff[10], controlField[99999];
	while(1)
	{
		strcpy(Keybuff, &quot;/0&quot;);
		recv(s2, Keybuff, sizeof(Keybuff), 0);
		strcat(controlField, Keybuff);
		SetDlgItemText(hwndDialog[2], IDC_EDIT1, controlField);
	}
</code></pre>
<p>kann mir bitte einer den code effizient und sinnvoll machen? Vector oder so wäre auch gut wenn es damit besser ist. Wäre echt cool <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1595468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595468</guid><dc:creator><![CDATA[arrayuser400]]></dc:creator><pubDate>Wed, 08 Oct 2008 11:32:34 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 12:14:29 GMT]]></title><description><![CDATA[<p>Nein. Das würde dir auch gar nichts bringen.<br />
Lies dich doch einfach zur STL ein, <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-143816.html" rel="nofollow">hier</a> z.B. erhältst du eine sehr gute Übersicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595497</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 08 Oct 2008 12:14:29 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 12:17:21 GMT]]></title><description><![CDATA[<p>es soll mir ja auch nichts bringen brauch das für die Uni könnte es bitte wer umformen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595500</guid><dc:creator><![CDATA[arrayuser400]]></dc:creator><pubDate>Wed, 08 Oct 2008 12:17:21 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 12:18:11 GMT]]></title><description><![CDATA[<p>arrayuser400 schrieb:</p>
<blockquote>
<p>es soll mir ja auch nichts bringen brauch das für die Uni könnte es bitte wer umformen?</p>
</blockquote>
<p>Nein, so erst recht nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595501</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 08 Oct 2008 12:18:11 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 14:07:27 GMT]]></title><description><![CDATA[<p>Die Dreisstheit der Gäste wird immer größer...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595575</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Wed, 08 Oct 2008 14:07:27 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 18:02:57 GMT]]></title><description><![CDATA[<blockquote>
<p>.&lt; ich programmiere ja eigentlich C aber es muss ja unbedingt mit vectoren sein</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1595765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595765</guid><dc:creator><![CDATA[arrayuser400]]></dc:creator><pubDate>Wed, 08 Oct 2008 18:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 18:03:47 GMT]]></title><description><![CDATA[<p>was würdet ihr denn dafür verlangen t.t</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595767</guid><dc:creator><![CDATA[arrayuser400]]></dc:creator><pubDate>Wed, 08 Oct 2008 18:03:47 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 18:34:19 GMT]]></title><description><![CDATA[<blockquote>
<p>was würdet ihr denn dafür verlangen t.t</p>
</blockquote>
<p>5000€ und eine Forensperre für Dich!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595800</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Wed, 08 Oct 2008 18:34:19 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 18:38:51 GMT]]></title><description><![CDATA[<p>Sollte eigentlich nicht allzu teuer werden. Schau vielleicht mal im Projekte-Forum nach.</p>
<p>Aber wenn du das für die Uni machen musst, wird dir wohl jemand beigebracht haben, wie so eine Aufgabe zu bewerkstelligen ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595809</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 08 Oct 2008 18:38:51 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 18:49:12 GMT]]></title><description><![CDATA[<p>way für 16 Posts nimmst du ja ganz schön was rauß!<br />
So ein kleiner wicht sollte lieber den ball flach halten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1595819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595819</guid><dc:creator><![CDATA[verteidiger]]></dc:creator><pubDate>Wed, 08 Oct 2008 18:49:12 GMT</pubDate></item><item><title><![CDATA[Reply to maximale anzahl an array elemente on Wed, 08 Oct 2008 21:26:38 GMT]]></title><description><![CDATA[<p>ich bin mal nicht so!</p>
<pre><code class="language-cpp">char Keybuff[10];
static vector&lt;char&gt; cvec;
    while(1)
    {
        recv(s2, Keybuff, sizeof(Keybuff), 0);
        cvec.push_back(Keybuff);
        SetDlgItemText(hwndDialog[2], IDC_EDIT1, cvec);
    }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1595908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1595908</guid><dc:creator><![CDATA[winspezi]]></dc:creator><pubDate>Wed, 08 Oct 2008 21:26:38 GMT</pubDate></item></channel></rss>