随笔分类 - C\C++
摘要:1. public base class 派生类必须为公有继承 2. virtual function 基类中必须包含虚函数 3. pointer reference invocation 必须采用指针或者引用来调用虚函数
阅读全文
摘要:IPerson.h Person.h Person.cpp IStudent.h Student.h Student.cpp main.cpp 测试结果 Student: Name: Leon, Age: 14, Grade: 8,IStudent: Name: Leon, Age: 14, Gra
阅读全文
摘要:使用static_cast运算符将子类转换为父类即可 运行结果: n: -5, m: -6n: 5, m: 6
阅读全文

浙公网安备 33010602011771号