#include "ClassA.h" #include int main() { ClassA a{}; a.Print(); ClassA *pA = nullptr; pA = new ClassA(); pA->Print(); // (*pA).Print(); // same line as above, but more complex to write delete pA; pA = nullptr; a.CompareTo(pA); IComparable *pComparable = nullptr; pComparable = new ClassA(); pComparable->CompareTo(pA); // pA = dynamic_cast(pComparable); delete pComparable; pComparable = nullptr; // copy object ClassA a2 = a; std::list list; std::list::iterator it; for (it = list.begin(); it != list.end(); ++it) { it->Print(); } std::list list2; std::list::iterator it2; for (it2 = list2.begin(); it2 != list2.end(); ++it2) { (*it2)->CompareTo(&a); } IComparable* pComparables[10]; return 0; }