例如,我有这样的课程:
class Base
{
public: void SomeFunc() { std::cout << "la-la-la\n"; }
};
我从中得到了新的:
class Child : public Base
{
void SomeFunc()
{
// Call somehow code from base class
std::cout << "Hello from child\n";
}
};
我想看看:
la-la-la
Hello from child
我可以从派生类调用方法吗?