My expected output here was " bc bvfunc b(1) dc dvfunc", but I got an output like "b(1) dc dvfunc" why is it so? Could somebody help me out? thanks for your precious time!
#include<iostream>
using namespace std;
class b {
public:
b() {
cout<<" bc ";
b::vfunc();
}
virtual void vfunc(){ cout<<" bvfunc "; }
b(int i){ cout<<" b(1) "; }
};
class d : public b {
public:
d(): b(1) {
cout<<" dc ";
d::vfunc();
}
void vfunc(){ cout<<" dvfunc"; }
};
main()
{
d d;
}