Hi guys,
I have a question regarding C++ classes and polymorphism. I understand the concept of pointers and that polymorphism with respect to operators(+, -, etc...) means that the operators can have different meanings based on "context" (how they are used). My question is regarding class pointers. For example, if in the following example code:
class ClassName
{
AnyMembers
};
class DerivedClassName : public ClassName
{
AnyMembers
} ;
ClassName* classPointerObject = new DerivedClassName;
How does "classPointerObject" relate to the derived class object?
Is this just a matter of a simple "is-a-type-of" relationship?
Your input would be greatly appreciated.
Thanks,
Navid