The following code, compiles & runs fine under MSVC .Net 2003, I just want to make sure, if, there is some complication here, like, construction/destruction being improper, or something like that, may be? I am not experienced enough, to judge myself.
Code:class Base {};
class Derived : public Base {
public: Base* basePtr;
};
class AnotherDerived : public Base {};
int main() {
Derived derived;
derived.basePtr = new AnotherDerived;
return 0;
}