摘要: 一 typeid与dynamic_cast 1)RTTI, Runtime Type Identification (RTTI) or Run-time type information (RTTI),表示在运行时动态决定变量的类型,来调用正确的虚函数。 RTTI在VS2008中默认为关闭,可以通过修改编译选项Enable Run-Time Type Info 为 Yes,来启用RTTI,只有... 阅读全文
posted @ 2009-03-01 19:36 iTech 阅读(3557) 评论(1) 推荐(0)
摘要: 一 虚继承 1) 代码: CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include using namespace std;class B{public: int i; virtual void vB(){ cout typ... 阅读全文
posted @ 2009-03-01 19:35 iTech 阅读(10650) 评论(2) 推荐(3)