Baffling behavior
- by sandeep
class A
{
public:
A()
{
}
};
class B : public A
{
public:
B()
{
}
};
int main()
{
A *a=new A();
B * b=static_cast<B*>(a);
///The above code compiles while if I replace above two line in main with below assignment it gives error.
A *a=new A();
B * b=new A();
}