﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-Martin Ding's Garden Plot-最新评论</title><link>http://www.cnitblog.com/martin/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Mon, 20 Oct 2008 07:25:26 GMT</pubDate><lastBuildDate>Mon, 20 Oct 2008 07:25:26 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: [转]谈谈C++继承中的重载，覆盖和隐藏</title><link>http://www.cnitblog.com/martin/archive/2010/03/16/9701.html#64683</link><dc:creator>哈哈哈</dc:creator><author>哈哈哈</author><pubDate>Tue, 16 Mar 2010 13:00:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2010/03/16/9701.html#64683</guid><description><![CDATA[@sunshine <br>你的目的是想实现覆盖操作。结果由于基类中函数float area(){ 没有关键字virtual，所以导致main函数中采用指针和引用调用派生类中函数时出现了错误，实际上，此时执行的是隐藏操作。 <br>自己再调试下，就会发现其中道理。  回复  更多评论<br>------------<br>这个其实就是个偏移地址的问题<img src ="http://www.cnitblog.com/martin/aggbug/64683.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">哈哈哈</a> 2010-03-16 21:00 <a href="http://www.cnitblog.com/martin/archive/2010/03/16/9701.html#64683#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]谈谈C++继承中的重载，覆盖和隐藏</title><link>http://www.cnitblog.com/martin/archive/2009/09/16/9701.html#61431</link><dc:creator>ericxiao</dc:creator><author>ericxiao</author><pubDate>Wed, 16 Sep 2009 03:52:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2009/09/16/9701.html#61431</guid><description><![CDATA[这是静态绑定的效果，呵呵，看看effective C++吧<img src ="http://www.cnitblog.com/martin/aggbug/61431.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">ericxiao</a> 2009-09-16 11:52 <a href="http://www.cnitblog.com/martin/archive/2009/09/16/9701.html#61431#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]谈谈C++继承中的重载，覆盖和隐藏</title><link>http://www.cnitblog.com/martin/archive/2009/05/16/9701.html#57253</link><dc:creator>水果柿子</dc:creator><author>水果柿子</author><pubDate>Sat, 16 May 2009 01:43:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2009/05/16/9701.html#57253</guid><description><![CDATA[@sunshine<br>你的目的是想实现覆盖操作。结果由于基类中函数float area(){ 没有关键字virtual，所以导致main函数中采用指针和引用调用派生类中函数时出现了错误，实际上，此时执行的是隐藏操作。<br>自己再调试下，就会发现其中道理。<img src ="http://www.cnitblog.com/martin/aggbug/57253.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">水果柿子</a> 2009-05-16 09:43 <a href="http://www.cnitblog.com/martin/archive/2009/05/16/9701.html#57253#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]谈谈C++继承中的重载，覆盖和隐藏[未登录]</title><link>http://www.cnitblog.com/martin/archive/2009/02/26/9701.html#54897</link><dc:creator>sunshine</dc:creator><author>sunshine</author><pubDate>Thu, 26 Feb 2009 08:53:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2009/02/26/9701.html#54897</guid><description><![CDATA[Martin，能否帮忙解释一下下面程序中的疑问：<br>#include &lt;iostream.h&gt;<br>class CShape<br>{<br>public:<br>	float area(){ return 0.0;}							<br>};<br>class CTriangle : public CShape<br>{<br>public:<br>	CTriangle(float h = 0, float w = 0)	<br>	{ 	H = h;	 W = w;	}<br>	float area()<br>	{	return (float)(H * W * 0.5); }	<br>private:<br>	float H, W;<br>};<br>class CCircle : public CShape<br>{<br>public:<br>	CCircle(float r = 0)	<br>	{	R = r;	}<br>	float area()<br>	{	return (float)(3.14159265 * R * R);	}<br>private:<br>	float R;<br>};<br>int main()<br>{<br>	CTriangle tri( 3, 4 );<br>	cout&lt;&lt;&quot;tri.area() = &quot;&lt;&lt;tri.area()&lt;&lt;endl;<br>	CCircle cir(5);<br>	cout&lt;&lt;&quot;cir.area() = &quot;&lt;&lt;cir.area()&lt;&lt;endl;<br>	CShape *s1 = &amp;tri;<br>	cout&lt;&lt;&quot;s1-&gt;area() = &quot;&lt;&lt;s1-&gt;area()&lt;&lt;endl;	CShape &amp;s2 = cir;<br>	cout&lt;&lt;&quot;s2.area() = &quot;&lt;&lt;s2.area()&lt;&lt;endl;<br>	return 0;<br>}<br>运行结果中s1-&gt;area()调用的竟然是CShape的成员函数area<br>如何理解CShape *s1=&amp;tri？谢谢！<img src ="http://www.cnitblog.com/martin/aggbug/54897.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">sunshine</a> 2009-02-26 16:53 <a href="http://www.cnitblog.com/martin/archive/2009/02/26/9701.html#54897#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]C++ sizeof 使用规则及陷阱分析[未登录]</title><link>http://www.cnitblog.com/martin/archive/2009/02/03/10815.html#54210</link><dc:creator>kai</dc:creator><author>kai</author><pubDate>Tue, 03 Feb 2009 07:01:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2009/02/03/10815.html#54210</guid><description><![CDATA[很好<img src ="http://www.cnitblog.com/martin/aggbug/54210.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">kai</a> 2009-02-03 15:01 <a href="http://www.cnitblog.com/martin/archive/2009/02/03/10815.html#54210#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]谈谈C++继承中的重载，覆盖和隐藏</title><link>http://www.cnitblog.com/martin/archive/2008/09/13/9701.html#49061</link><dc:creator>water</dc:creator><author>water</author><pubDate>Sat, 13 Sep 2008 03:22:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2008/09/13/9701.html#49061</guid><description><![CDATA[刚学完继承和多态，看楼主的文章觉得很好，特备是隐藏，谢谢<img src ="http://www.cnitblog.com/martin/aggbug/49061.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">water</a> 2008-09-13 11:22 <a href="http://www.cnitblog.com/martin/archive/2008/09/13/9701.html#49061#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]C++ sizeof 使用规则及陷阱分析</title><link>http://www.cnitblog.com/martin/archive/2008/09/08/10815.html#48833</link><dc:creator>dd</dc:creator><author>dd</author><pubDate>Mon, 08 Sep 2008 02:57:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2008/09/08/10815.html#48833</guid><description><![CDATA[很好<img src ="http://www.cnitblog.com/martin/aggbug/48833.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">dd</a> 2008-09-08 10:57 <a href="http://www.cnitblog.com/martin/archive/2008/09/08/10815.html#48833#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]C++ sizeof 使用规则及陷阱分析</title><link>http://www.cnitblog.com/martin/archive/2008/03/14/10815.html#40898</link><dc:creator>sanwa</dc:creator><author>sanwa</author><pubDate>Thu, 13 Mar 2008 16:00:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2008/03/14/10815.html#40898</guid><description><![CDATA[很长见识<img src ="http://www.cnitblog.com/martin/aggbug/40898.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">sanwa</a> 2008-03-14 00:00 <a href="http://www.cnitblog.com/martin/archive/2008/03/14/10815.html#40898#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: [转]C++ sizeof 使用规则及陷阱分析</title><link>http://www.cnitblog.com/martin/archive/2007/10/12/10815.html#34791</link><dc:creator>slaxh</dc:creator><author>slaxh</author><pubDate>Fri, 12 Oct 2007 15:10:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2007/10/12/10815.html#34791</guid><description><![CDATA[挺清楚，谢谢<img src ="http://www.cnitblog.com/martin/aggbug/34791.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">slaxh</a> 2007-10-12 23:10 <a href="http://www.cnitblog.com/martin/archive/2007/10/12/10815.html#34791#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: CVS-Commands</title><link>http://www.cnitblog.com/martin/archive/2007/10/07/9146.html#34490</link><dc:creator>点大</dc:creator><author>点大</author><pubDate>Sun, 07 Oct 2007 15:15:00 GMT</pubDate><guid>http://www.cnitblog.com/martin/archive/2007/10/07/9146.html#34490</guid><description><![CDATA[好的...<img src ="http://www.cnitblog.com/martin/aggbug/34490.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/martin/" target="_blank">点大</a> 2007-10-07 23:15 <a href="http://www.cnitblog.com/martin/archive/2007/10/07/9146.html#34490#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>