K
Ken Durden
Hey,
I'm trying to access a function in my base class's base class. I want
to skip one level in the hierarchy.
class A
{
virtual void foo()
{ Console.WriteLine( "A::foo" ); }
}
class B : A
{
virtual void foo()
{ Console.WriteLine( "B::foo" ); }
}
class C : B
{
virtual void foo()
{
Console.WriteLine( "C::goo" ); }
xxxx.foo(); // should print A::foo
}
}
I've tried:
A.foo();
base.A.foo();
this.A.foo();
base.base.foo();
I know I can do this by putting a function on B which calls A::foo()
such as
class B
{
void A_foo()
{
base.foo();
}
}
But this is exceedingly dumb.
Is what I want to do possible?
-ken
I'm trying to access a function in my base class's base class. I want
to skip one level in the hierarchy.
class A
{
virtual void foo()
{ Console.WriteLine( "A::foo" ); }
}
class B : A
{
virtual void foo()
{ Console.WriteLine( "B::foo" ); }
}
class C : B
{
virtual void foo()
{
Console.WriteLine( "C::goo" ); }
xxxx.foo(); // should print A::foo
}
}
I've tried:
A.foo();
base.A.foo();
this.A.foo();
base.base.foo();
I know I can do this by putting a function on B which calls A::foo()
such as
class B
{
void A_foo()
{
base.foo();
}
}
But this is exceedingly dumb.
Is what I want to do possible?
-ken