Hi, i have
class Base
{
Base* next;
}
class Class1 : Base
{
}
Base* pBase = new Base();
Class1* pTest = new Class1();
pBase->next = pTest;
Class1* pClass1;
pClass1 = (Class1*)pBase->next;
I want to be able to write
pClass1 = pBase->next;
and get no compilation error C2440 (cannot convert). Or in other words I want pClass1 point to a class that pBase->next points to.
Is it possible with some operator overloading? How to do it?