<?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[dynamische speicherreservierung]]></title><description><![CDATA[<p>int*x = new int[10000....]</p>
<p>wenn nicht genügend zusammenhängender speicher zur verfügung steht<br />
liefert new den NULL pointer zurück. Aber was soll ich in diesem<br />
Fall als programmierer machen . Einfach das programm abstürzen lassen ?<br />
z.b. exit (1) ?? Geht das oder gibt's nee andere Möglichkeit . Bye</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/252848/dynamische-speicherreservierung</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 04:54:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/252848.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Oct 2009 14:19:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 14:19:23 GMT]]></title><description><![CDATA[<p>int*x = new int[10000....]</p>
<p>wenn nicht genügend zusammenhängender speicher zur verfügung steht<br />
liefert new den NULL pointer zurück. Aber was soll ich in diesem<br />
Fall als programmierer machen . Einfach das programm abstürzen lassen ?<br />
z.b. exit (1) ?? Geht das oder gibt's nee andere Möglichkeit . Bye</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1797996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1797996</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 14:19:23 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 14:23:41 GMT]]></title><description><![CDATA[<p>Also Valve macht es so, dass einfach ein assert() aufgerufen wird...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1797999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1797999</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Sun, 25 Oct 2009 14:23:41 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 14:24:53 GMT]]></title><description><![CDATA[<p>Du fängst in der main() einfach die exception.<br />
und nein, es ist unwahr, daß das ding NULL zurückliefern würde. dein buch ist auf dem stand von vor 22 jahren. das mußt du doch am vergilbten papier bemerken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798001</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 25 Oct 2009 14:24:53 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 14:37:01 GMT]]></title><description><![CDATA[<p>Wie würde das dann in diesem Beispiel aussehen.</p>
<p>matrix=new double[zeilen*spalten];</p>
<p>also:</p>
<p>try{</p>
<p>matrix=new double[zeilen*spalten];<br />
}</p>
<p>catch(matrix)<br />
{<br />
cout&lt;&lt;&quot;Geben sie eine kleinere Matrix ein &quot; ;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798009</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 14:37:01 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 14:39:18 GMT]]></title><description><![CDATA[<p><a href="http://www.cplusplus.com/reference/std/new/" rel="nofollow">http://www.cplusplus.com/reference/std/new/</a><br />
(siehe bad_alloc)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798012</guid><dc:creator><![CDATA[Sebastian Pizer]]></dc:creator><pubDate>Sun, 25 Oct 2009 14:39:18 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 14:48:06 GMT]]></title><description><![CDATA[<p>was passiert im realen FAll wenn der Pointer tatsächlich NULL wäre.<br />
Würde das Programm wirklich abstürzen oder was passiert ?</p>
<p>Muss ich eigentlich throw benutzen ?</p>
<p>z.B. if (matrix== NULL ) throw ( ) wie funktioniert das ?</p>
<p>DAnke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798019</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798019</guid><dc:creator><![CDATA[blurry33]]></dc:creator><pubDate>Sun, 25 Oct 2009 14:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 15:19:24 GMT]]></title><description><![CDATA[<p>blurry33 schrieb:</p>
<blockquote>
<p>Wie würde das dann in diesem Beispiel aussehen.</p>
<p>matrix=new double[zeilen*spalten];</p>
<p>also:</p>
<p>try{</p>
<p>matrix=new double[zeilen*spalten];<br />
}</p>
<p>catch(matrix)<br />
{<br />
cout&lt;&lt;&quot;Geben sie eine kleinere Matrix ein &quot; ;<br />
}</p>
</blockquote>
<p>fast.</p>
<p>matrix=new double[zeilen*spalten];</p>
<p>also:</p>
<pre><code class="language-cpp">try{
   matrix=new double[zeilen*spalten];
   cout&lt;&lt;&quot;Geben sie eine Matrix ein &quot; ;
   rechnerechne();
   cout&lt;&lt;&quot;Ergebnis.\n&quot;;
   return 0;
}
catch(std::bad_alloc&amp; e){
   cout&lt;&lt;&quot;Kritischer Anwendungsfehler!\n&quot;;
   cout&lt;&lt;&quot;Es ist ein Fehler aufgetreten. Bitte rufen Sie Ihren Administrator an.\n&quot;;
   return 1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1798038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798038</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 25 Oct 2009 15:19:24 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 15:18:36 GMT]]></title><description><![CDATA[<p>blurry33 schrieb:</p>
<blockquote>
<p>z.B. if (matrix== NULL ) throw ( ) wie funktioniert das ?</p>
</blockquote>
<p>Genau dieses ifthrow ist seit Äonen im new innendrin schon eingebaut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798039</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 25 Oct 2009 15:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 16:45:18 GMT]]></title><description><![CDATA[<p>blurry33 schrieb:</p>
<blockquote>
<p>was passiert im realen FAll wenn der Pointer tatsächlich NULL wäre.</p>
</blockquote>
<p>Der Zeiger wird niemals Null sein, wenn du das ganz normale <code>new[]</code> benutzt. Übrigens solltest du <code>delete[]</code> nicht vergessen, um den Speicher wieder freizugeben.</p>
<p>Kóyaánasqatsi schrieb:</p>
<blockquote>
<p>Also Valve macht es so, dass einfach ein assert() aufgerufen wird...</p>
</blockquote>
<p>Was wird dort genau geprüft?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798097</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 25 Oct 2009 16:45:18 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 16:47:01 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>Was wird dort genau geprüft?</p>
</blockquote>
<p>Genau weiß ich es nicht, habe den Code (leider) noch nicht sehen dürfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798100</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Sun, 25 Oct 2009 16:47:01 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische speicherreservierung on Sun, 25 Oct 2009 19:41:51 GMT]]></title><description><![CDATA[<p>Kóyaánasqatsi schrieb:</p>
<blockquote>
<p>Nexus schrieb:</p>
<blockquote>
<p>Was wird dort genau geprüft?</p>
</blockquote>
<p>Genau weiß ich es nicht, habe den Code (leider) noch nicht sehen dürfen.</p>
</blockquote>
<p>wenn du es nicht genau weist, wieso schreibst du dann so was?<br />
denkst du, du hilfst somit irgendwem?</p>
<p>auf jeden fall klang es so, als ob du folgendes meintest:</p>
<pre><code class="language-cpp">int* foo = new int[9999999];
assert(foo);
</code></pre>
<p>was in doppelter hinsicht bescheuert wäre...</p>
<p>assert == logikfehler<br />
bad_alloc == laufzeitfehler</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1798216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1798216</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sun, 25 Oct 2009 19:41:51 GMT</pubDate></item></channel></rss>