Trusted Versus Checked
struct Animal { virtual ~Animal() = default; };
struct Dog : Animal {};
struct Cat : Animal {};
Animal *a = new Cat();
Dog *d1 = static_cast<Dog *>(a);
Dog *d2 = dynamic_cast<Dog *>(a);
Which statement is true?
Sign in to answer questions and track your progress
Sign In