The C++ syntax is like this:
class Bar : public Foo {
// ...
void printStuff() {
Foo::printStuff(); // calls base class' function
}
};
More Related Contents:
- Calling virtual functions inside constructors
- C++ “virtual” keyword for functions in derived classes. Is it necessary?
- C++ virtual function return type
- Is the ‘override’ keyword just a check for a overridden virtual method?
- What are the differences between overriding virtual functions and hiding non-virtual functions?
- Override a member function with different return type
- Force all classes to implement / override a ‘pure virtual’ method in multi-level inheritance hierarchy
- Overriding public virtual functions with private functions in C++
- can a pure virtual function has parameters?
- Can a class member function template be virtual?
- How are virtual functions and vtable implemented?
- Are inline virtual functions really a non-sense?
- Alternative virtual function calls implementations?
- What is the ‘override’ keyword in C++ used for? [duplicate]
- Where do “pure virtual function call” crashes come from?
- Overriding a Base’s Overloaded Function in C++ [duplicate]
- What is the first (int (*)(…))0 vtable entry in the output of g++ -fdump-class-hierarchy?
- C++ object size with virtual methods
- Inheritance and method overloading
- What is the performance cost of having a virtual method in a C++ class?
- Ways to detect whether a C++ virtual function has been redefined in a derived class
- Override and overload in C++
- C++ virtual override functions with same name
- Object oriented programming in Haskell
- Performance penalty for working with interfaces in C++?
- C++: Pointer to monomorphic version of virtual member function?
- C++: Why does a struct\class need a virtual method in order to be polymorphic?
- Mechanism of Vptr and Vtable in C++
- Can I get polymorphic behavior without using virtual functions?
- Use-cases of pure virtual functions with body?