A very simple example, showing how "Derived" inherits the functionality from "Base".
Code:
#include <iostream>
class Base
{
public:
void basefunction() { std::cout << "In Base" << std::endl; }
};
class Derived : public Base
{
public:
void derivedfunction() { std::cout << "In Derived" << std::endl; }
};
int main()
{
Base b;
Derived d;
b.basefunction();
d.basefunction();
d.derivedfunction();
return 0;
}
I don't know what you mean by that formula, could you be more specific?