using namespace std;
class B
{
public:
virtual int shift(int n = 2) const { cout<<"B"<
class D
: public B
{
public:
D() {}
public:
int shift(int n = 3) const { cout<<"D"<
int main()
{
const D d;
const B *b = &d;
std::cout << b->shift() << std::endl; ////2<<3 16="" strong="">3>
return 0;
}
No comments:
Post a Comment