C
C++fan
Hi all:
Below is simple code:
class bs {
public:
virtual void handle() = 0;
};
class driv : public bs {
public:
void handle();
};
void driv::handle(){
cout << "hello " <<endl;
};
void funct(bs* b){
b -> handle();
};
In funct(), will b->handle() invoke the handle() of class driv or the
handle() class bs?
And why?
Thanks.
Jack
Below is simple code:
class bs {
public:
virtual void handle() = 0;
};
class driv : public bs {
public:
void handle();
};
void driv::handle(){
cout << "hello " <<endl;
};
void funct(bs* b){
b -> handle();
};
In funct(), will b->handle() invoke the handle() of class driv or the
handle() class bs?
And why?
Thanks.
Jack