I was wondering if anyone knows if it is possible in C++ to make a pointer to a class type, or something in that direction... I don't think it is, but maybe I'll get lucky I know I can make a pointer to a class this way:
myClass* classPointer;
But that's not what I'm looking for. I'm looking for a feature where you can make a variable contain a class type. I mean something like this:
class myClass1{};
class myClass2{};
sometype classContainer = &myClass1;
classContainer = &myClass2;
pointerToClass classPointer = new classContainer;
Kinda like this... I guess the two classes (myClass1 & myClass2) need to inherit the same class or something like that. Is this possible? Is it very complicated? If it is just say so I guess this is a really weird way of accomplishing what I want and I don't really need this so if it isn't possible or very hard it doesn't matter, I guess i'm still a beginner ^^.
Thanks in advance!