S
Subhransu Sahoo
Hi All,
Can anyone tell me why the output of the following program is fx1 fx2 ?
#include <iostream>
using namespace std;
class IX
{
public:
virtual void fx1() {cout<<"fx1"<<endl;}
virtual void fx2() {cout<<"fx2"<<endl;}
};
class IY
{
public:
virtual void fy1() {cout<<"fy1"<<endl;}
virtual void fy2() {cout<<"fy2"<<endl;}
};
class CA ublic IX, public IY {};
void main()
{
IY *yobj = reinterpret_cast<IY*>(static_cast<IX*>(new CA));
yobj->fy1();
yobj->fy2();
}
Regards,
Subhransu
Can anyone tell me why the output of the following program is fx1 fx2 ?
#include <iostream>
using namespace std;
class IX
{
public:
virtual void fx1() {cout<<"fx1"<<endl;}
virtual void fx2() {cout<<"fx2"<<endl;}
};
class IY
{
public:
virtual void fy1() {cout<<"fy1"<<endl;}
virtual void fy2() {cout<<"fy2"<<endl;}
};
class CA ublic IX, public IY {};
void main()
{
IY *yobj = reinterpret_cast<IY*>(static_cast<IX*>(new CA));
yobj->fy1();
yobj->fy2();
}
Regards,
Subhransu