再问“关于对象的继承”
iBear 2002-08-24 02:49:08 在delphi中:
procedure TSomeClass.SomeMothed;
begin
...
inherited;
...
end;
当TSomeClass的基类中实现了SomeMothed方法的话,将在inherited处调用该方法;否则就忽略。
但在c++中:
void TSomeClass::SomeMothed(void)
{
...
TBaseClass::SomeMothed();//TBaseClass为TSomeClass的基类
...
}
如果基类中实现了SomeMothed方法的话,没问题;
但要是基类中没有实现该方法,上述代码显然连编译也不能通过的,
因此问题的关键是如何在c++(BCB)中实现delphi的继承方式!