<?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[dynamisch speicher allokieren]]></title><description><![CDATA[<p>hallo!</p>
<p>ich will dynamisch speicher für matrizen allokieren.<br />
das klappt auch alles wunderbar bis ich ungefähr 2500 Byte allokiert habe.<br />
dann kriege ich eine access-violation-exception wenn ich speicher inne gewissen intervall allokieren möchte:</p>
<p>fehler treten auf bei:</p>
<p>inventory[0]=(float *)malloc(800);<br />
inventory[0]=(float *)malloc(900);</p>
<p>klappen tun:</p>
<p>inventory[0]=(float *)malloc(100);<br />
inventory[0]=(float *)malloc(1000);</p>
<p>so nem phänomen bin ich noch nie begegnet. fällt da wem was ein?<br />
meiner meinung nach kann das nciht an c liegen. setzt da villeicht vs grenzen?</p>
<p>danke<br />
dirk</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/57229/dynamisch-speicher-allokieren</link><generator>RSS for Node</generator><lastBuildDate>Tue, 02 Jun 2026 12:01:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/57229.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Dec 2003 22:20:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dynamisch speicher allokieren on Tue, 02 Dec 2003 22:20:07 GMT]]></title><description><![CDATA[<p>hallo!</p>
<p>ich will dynamisch speicher für matrizen allokieren.<br />
das klappt auch alles wunderbar bis ich ungefähr 2500 Byte allokiert habe.<br />
dann kriege ich eine access-violation-exception wenn ich speicher inne gewissen intervall allokieren möchte:</p>
<p>fehler treten auf bei:</p>
<p>inventory[0]=(float *)malloc(800);<br />
inventory[0]=(float *)malloc(900);</p>
<p>klappen tun:</p>
<p>inventory[0]=(float *)malloc(100);<br />
inventory[0]=(float *)malloc(1000);</p>
<p>so nem phänomen bin ich noch nie begegnet. fällt da wem was ein?<br />
meiner meinung nach kann das nciht an c liegen. setzt da villeicht vs grenzen?</p>
<p>danke<br />
dirk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406879</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406879</guid><dc:creator><![CDATA[vincentve]]></dc:creator><pubDate>Tue, 02 Dec 2003 22:20:07 GMT</pubDate></item><item><title><![CDATA[Reply to dynamisch speicher allokieren on Tue, 02 Dec 2003 22:37:17 GMT]]></title><description><![CDATA[<p>VisualStudio grenzt dich hier nicht ein, sondern du greifst auf Speicher zu der dir nicht gehört. Schonmal überlegt dir genug Speicher anzufordern?</p>
<p>inventory[0]=(float <em>)malloc(800</em>sizeof(float));</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406893</guid><dc:creator><![CDATA[Walli]]></dc:creator><pubDate>Tue, 02 Dec 2003 22:37:17 GMT</pubDate></item><item><title><![CDATA[Reply to dynamisch speicher allokieren on Tue, 02 Dec 2003 22:38:09 GMT]]></title><description><![CDATA[<p>Btw. was ist inventory[0] überhaupt und wie greifst du zu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406894</guid><dc:creator><![CDATA[Walli]]></dc:creator><pubDate>Tue, 02 Dec 2003 22:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to dynamisch speicher allokieren on Wed, 03 Dec 2003 07:26:24 GMT]]></title><description><![CDATA[<p>ok, also soll es als ganzes aussehen:<br />
das prinzip funktioniert u ich kann zwar grundsätzlich nicht ausschließen, dass ein fehler drin ist, aber dieseleb konstruktion hab ich ein paar mal im prog und da läuft es anstandslos.</p>
<p>beim allkoieren kann ich doch kaum auf speicher zugrifen der mir nicht gehört, oder?<br />
es denn es liegt an productionCost (vorher allkoiert) oder items oder periods (beide lt debugger ordentlich gefüllt).</p>
<p>float **productionCost;<br />
productionCost=(float **)malloc(items*sizeof(float *));<br />
productionCost[0]=(float <em>)malloc(items*periods*sizeof(float));<br />
for (i=1; i&lt;items; i++)<br />
{<br />
productionCost[i]=productionCost[i-1]+periods</em>sizeof(float);<br />
}<br />
for (i=0; i&lt;items; i++)<br />
{<br />
for (j=0; j&lt;periods; j++)<br />
{<br />
productionCost[i][j]=0;<br />
}<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/406967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/406967</guid><dc:creator><![CDATA[vincentve]]></dc:creator><pubDate>Wed, 03 Dec 2003 07:26:24 GMT</pubDate></item></channel></rss>