<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: 12.3 &#8212; Virtual destructors, virtual assignment, and overriding virtualization</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/</link>
	<description></description>
	<pubDate>Wed, 20 Aug 2008 08:26:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Ben</title>
		<link>http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-23059</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 07 Aug 2008 15:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-23059</guid>
		<description>What a stupid mistake, i would never do this. Every child knows, that you have to delete () m_pnArray...
Damn it, i really did it with this sort of brackets and it was quite confusing, because i didn't see the mistake at first glance.</description>
		<content:encoded><![CDATA[<p>What a stupid mistake, i would never do this. Every child knows, that you have to delete () m_pnArray&#8230;<br />
Damn it, i really did it with this sort of brackets and it was quite confusing, because i didn&#8217;t see the mistake at first glance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-21660</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 24 Jul 2008 01:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-21660</guid>
		<description>You are correct.  This is one of the things I constantly screw up in C++.</description>
		<content:encoded><![CDATA[<p>You are correct.  This is one of the things I constantly screw up in C++.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandhya</title>
		<link>http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-20718</link>
		<dc:creator>sandhya</dc:creator>
		<pubDate>Fri, 11 Jul 2008 08:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-20718</guid>
		<description>Hi Alex,

In the example for virtual destructor
class Derived: public Base   
{   
private:   
    int* m_pnArray;   
  
public:   
    Derived(int nLength)   
    {   
        m_pnArray = new int[nLength];   
    }   
  
    virtual ~Derived()   
    {   
        cout &#60;&#60; "Calling ~Derived()" &#60;&#60; endl;   
        delete m_pnArray;   
    }   
};

In the constructor, you have dynamically allocated an integer array using new operator. But in destructor, you have used only "delete m_pnArray;" where u should have used "delete[] m_pnArray;". Correct me if i am wrong.</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>In the example for virtual destructor<br />
class Derived: public Base<br />
{<br />
private:<br />
    int* m_pnArray;   </p>
<p>public:<br />
    Derived(int nLength)<br />
    {<br />
        m_pnArray = new int[nLength];<br />
    }   </p>
<p>    virtual ~Derived()<br />
    {<br />
        cout &lt;&lt; &#8220;Calling ~Derived()&#8221; &lt;&lt; endl;<br />
        delete m_pnArray;<br />
    }<br />
};</p>
<p>In the constructor, you have dynamically allocated an integer array using new operator. But in destructor, you have used only &#8220;delete m_pnArray;&#8221; where u should have used &#8220;delete[] m_pnArray;&#8221;. Correct me if i am wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 12.2 &#8212; Virtual functions</title>
		<link>http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-14427</link>
		<dc:creator>Learn C++ - &#187; 12.2 &#8212; Virtual functions</dc:creator>
		<pubDate>Mon, 05 May 2008 02:24:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/#comment-14427</guid>
		<description>[...] Posts   &#171; 12.1 &#8212; Pointers and references to the base class of derived objects &#124; Home &#124; 12.3 &#8212; Virtual destructors, virtual assignment, and overriding virtualization &#187;     Wednesday, January 30th, 2008 at 3:46 [...]</description>
		<content:encoded><![CDATA[<p>[...] Posts   &laquo; 12.1 &#8212; Pointers and references to the base class of derived objects | Home | 12.3 &#8212; Virtual destructors, virtual assignment, and overriding virtualization &raquo;     Wednesday, January 30th, 2008 at 3:46 [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
