<?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[new &amp;amp; delete]]></title><description><![CDATA[<pre><code>int* i = new int;
delete (char*)i;
</code></pre>
<p>Was passiert hier? Wird der gesammte allokierte Speicher fregegeben? Nur ein Byte? Eine Exception geworfen? ...?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/277540/new-amp-delete</link><generator>RSS for Node</generator><lastBuildDate>Tue, 25 Aug 2026 20:55:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/277540.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 20 Nov 2010 13:09:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to new &amp;amp; delete on Sat, 20 Nov 2010 13:09:27 GMT]]></title><description><![CDATA[<pre><code>int* i = new int;
delete (char*)i;
</code></pre>
<p>Was passiert hier? Wird der gesammte allokierte Speicher fregegeben? Nur ein Byte? Eine Exception geworfen? ...?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1983212</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1983212</guid><dc:creator><![CDATA[Mr X]]></dc:creator><pubDate>Sat, 20 Nov 2010 13:09:27 GMT</pubDate></item><item><title><![CDATA[Reply to new &amp;amp; delete on Sat, 20 Nov 2010 13:21:30 GMT]]></title><description><![CDATA[<p>Das dürfte undefiniertes Verhalten erzeugen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1983218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1983218</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Sat, 20 Nov 2010 13:21:30 GMT</pubDate></item><item><title><![CDATA[Reply to new &amp;amp; delete on Sat, 20 Nov 2010 15:15:35 GMT]]></title><description><![CDATA[<p>Beleg dafür:</p>
<p>&lt;a href= schrieb:</p>
<blockquote>
<p>C++-Standard&quot;&gt;[...] the value of the operand of delete shall be a pointer to a non-array object created by a new-expression, or a pointer to a sub-object representing a base class of such an object. If not, the behavior is undefined.</p>
<p>[...] if the static type of the operand is different from its dynamic type, the static type shall be a base class of the operand's dynamic type and the static type shall have a virtual destructor or the behavior is undefined.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1983257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1983257</guid><dc:creator><![CDATA[hayfig]]></dc:creator><pubDate>Sat, 20 Nov 2010 15:15:35 GMT</pubDate></item></channel></rss>