上一页 1 ··· 16 17 18 19 20
  2015年3月24日
摘要: C++中四种类型转换运算符的使用方法。reinterpret_cast,dynamic_cast,const_cast,static_cast都是函数。1、reinterpret_castreinterpret_cast(1)该函数将一个类型的指针转换为另一个类型的指针。这种转换不用修改指针变量值存... 阅读全文
posted @ 2015-03-24 11:05 bendantuohai 阅读(161) 评论(0) 推荐(0) 编辑
摘要: C++多态的实现及原理详细解析作者: 字体:[增加减小] 类型:转载C++的多态性用一句话概括就是:在基类的函数前加上virtual关键字,在派生类中重写该函数,运行时将会根据对象的实际类型来调用相应的函数。如果对象类型是派生类,就调用派生类的函数;如果对象类型是基类,就调用基类的函数1. 用vir... 阅读全文
posted @ 2015-03-24 09:29 bendantuohai 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20