<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 12.6 &#8212; Pure virtual functions, abstract base classes, and interface classes</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: saurabh</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-96905</link>
		<dc:creator>saurabh</dc:creator>
		<pubDate>Mon, 06 Feb 2012 00:16:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-96905</guid>
		<description>I learned a lot from your tutorials and kudos to you

It will be great if you can add two more topics to this chapter

1) We can define body for a pure virtual function so please add when, why and how ?
2) Please add virtual table view for abstract class why compiler not letting us to instantiate abstract class or i should say class having and pure virtual function

Here is my views:
we can not  make object of abstract class because, in the vtable the vtable entry for the abstract class functions will be NULL, even if there is a single pure virtual function in the class the class becomes as abstract class.Even if there is a single NULL entry in the function table the compiler does not allow to create the object.</description>
		<content:encoded><![CDATA[<p>I learned a lot from your tutorials and kudos to you</p>
<p>It will be great if you can add two more topics to this chapter</p>
<p>1) We can define body for a pure virtual function so please add when, why and how ?<br />
2) Please add virtual table view for abstract class why compiler not letting us to instantiate abstract class or i should say class having and pure virtual function</p>
<p>Here is my views:<br />
we can not  make object of abstract class because, in the vtable the vtable entry for the abstract class functions will be NULL, even if there is a single pure virtual function in the class the class becomes as abstract class.Even if there is a single NULL entry in the function table the compiler does not allow to create the object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spartan</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-96892</link>
		<dc:creator>spartan</dc:creator>
		<pubDate>Tue, 31 Jan 2012 04:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-96892</guid>
		<description>Simply awesome</description>
		<content:encoded><![CDATA[<p>Simply awesome</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gans</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-95146</link>
		<dc:creator>gans</dc:creator>
		<pubDate>Tue, 01 Feb 2011 11:46:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-95146</guid>
		<description>Hi,
As reply to Ricky&#039;s question:

In C++ there is also a concept called &quot;Late binding yet static typing&quot;. That is
When you have a pointer to object and object is derived from the type of class of type pointer, there are two types,1) type of the pointer: static 2) type of pointed-to-object: dynamic.
Here static typing means, the legality of the function call is determined by the compiler at compile time, since pointer is Base and Base has public virtual function. compiler validates the function calling. but at run time, since you have assigned the derived object address, it resolves the derived function only.

Hope this helps u.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
As reply to Ricky&#8217;s question:</p>
<p>In C++ there is also a concept called &#8220;Late binding yet static typing&#8221;. That is<br />
When you have a pointer to object and object is derived from the type of class of type pointer, there are two types,1) type of the pointer: static 2) type of pointed-to-object: dynamic.<br />
Here static typing means, the legality of the function call is determined by the compiler at compile time, since pointer is Base and Base has public virtual function. compiler validates the function calling. but at run time, since you have assigned the derived object address, it resolves the derived function only.</p>
<p>Hope this helps u.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kathy</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-94918</link>
		<dc:creator>Kathy</dc:creator>
		<pubDate>Sun, 14 Nov 2010 04:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-94918</guid>
		<description>petrfect tutorial~~

I have learned a lot...</description>
		<content:encoded><![CDATA[<p>petrfect tutorial~~</p>
<p>I have learned a lot&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ricky</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-90958</link>
		<dc:creator>ricky</dc:creator>
		<pubDate>Fri, 27 Aug 2010 07:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-90958</guid>
		<description>just a simple program..

&lt;pre&gt;#include &quot;stdafx.h&quot;
#include &quot;iostream&quot;
#include &quot;conio.h&quot;
using namespace std;

class base
{
	public :
	int x;
	virtual void display();
};
void base::display()
{
	x =100;
	cout&lt;&lt;x&lt;&lt;&quot; Display Base&quot;&lt;&lt;endl;
}
class derived : public base
{
	void display();
};
void derived::display()
{
	x =50;cout&lt;&lt;x&lt;&lt;&quot; Display Derived&quot;;
}
int _tmain(int argc, _TCHAR* argv[])
{
	base B1;
	derived d1;
	base *b1ptr;
	b1ptr = &amp;B1;
	b1ptr-&gt;display();

	b1ptr = &amp;d1;

	b1ptr-&gt;display();
	//d1.base::display();
	getch();
	return 0;
}&lt;/pre&gt;)


my doubt:

How am I able to access the private member of derived class function (**which is private) using base class pointer??</description>
		<content:encoded><![CDATA[<p>just a simple program..</p>
<pre>#include &quot;stdafx.h&quot;
#include &quot;iostream&quot;
#include &quot;conio.h&quot;
using namespace std;

class base
{
	public :
	int x;
	virtual void display();
};
void base::display()
{
	x =100;
	cout&lt;&lt;x&lt;&lt;&quot; Display Base&quot;&lt;&lt;endl;
}
class derived : public base
{
	void display();
};
void derived::display()
{
	x =50;cout&lt;&lt;x&lt;&lt;&quot; Display Derived&quot;;
}
int _tmain(int argc, _TCHAR* argv[])
{
	base B1;
	derived d1;
	base *b1ptr;
	b1ptr = &amp;B1;
	b1ptr-&gt;display();

	b1ptr = &amp;d1;

	b1ptr-&gt;display();
	//d1.base::display();
	getch();
	return 0;
}</pre>
<p>)</p>
<p>my doubt:</p>
<p>How am I able to access the private member of derived class function (**which is private) using base class pointer??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sachin kumar</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-89255</link>
		<dc:creator>sachin kumar</dc:creator>
		<pubDate>Thu, 29 Jul 2010 16:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-89255</guid>
		<description>verry good website</description>
		<content:encoded><![CDATA[<p>verry good website</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LJ</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-77865</link>
		<dc:creator>LJ</dc:creator>
		<pubDate>Thu, 04 Feb 2010 20:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-77865</guid>
		<description>this is definitely the best tutorial i&#039;ve found so far on c++. great work! 
another quick nitpick: the mySqrt function does not take the square root :)</description>
		<content:encoded><![CDATA[<p>this is definitely the best tutorial i&#8217;ve found so far on c++. great work!<br />
another quick nitpick: the mySqrt function does not take the square root :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-74070</link>
		<dc:creator>Garrett</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-74070</guid>
		<description>Quick nitpick on the HTML in this page - the top of the page with next/previous post lists 7.13 as the next topic instead of 13.1.

P.S.: Excellent website for learning C++.  Thank you very much for providing this resource.  I&#039;ll be sure to refer people here when appropriate!</description>
		<content:encoded><![CDATA[<p>Quick nitpick on the HTML in this page &#8211; the top of the page with next/previous post lists 7.13 as the next topic instead of 13.1.</p>
<p>P.S.: Excellent website for learning C++.  Thank you very much for providing this resource.  I&#8217;ll be sure to refer people here when appropriate!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tunc</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-68040</link>
		<dc:creator>Tunc</dc:creator>
		<pubDate>Thu, 10 Sep 2009 08:51:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-68040</guid>
		<description>why compile give me an error &quot;IErrorLog cannot access private member declared in class &quot;IErrorLog&quot;</description>
		<content:encoded><![CDATA[<p>why compile give me an error &#8220;IErrorLog cannot access private member declared in class &#8220;IErrorLog&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sudheer</title>
		<link>http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/comment-page-1/#comment-62222</link>
		<dc:creator>sudheer</dc:creator>
		<pubDate>Wed, 10 Jun 2009 13:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/126-pure-virtual-functions-abstract-base-classes-and-interface-classes/#comment-62222</guid>
		<description>Wonderful tutorial on Pure Virtual functions. Kudos Alex</description>
		<content:encoded><![CDATA[<p>Wonderful tutorial on Pure Virtual functions. Kudos Alex</p>
]]></content:encoded>
	</item>
</channel>
</rss>

