In c++ I would do
class A { public: virtual void stuff() { //something } }; class B : public A public: virtual void stuff() { //something2 A::stuff() //something } };
How would I do this in C#? I've tried
public void stuff() { //something2 A.stuff(); //something }
but that doesn't work
Access Overridden Function in C++ To access the overridden function of the base class, we use the scope resolution operator :: . We can also access the overridden function by using a pointer of the base class to point to an object of the derived class and then calling the function from that pointer.
base
is the keyword for referencing your superclass in C#. Use:
base.stuff();
Use base
. Like base.stuff();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With