(Programming Language Test) When casting an object of a polymorphic class from a base class, which kind of cast executes only if it's is valid?
Anonymous
Also, it's important to note the difference between using pointers vs references in the case of casts. In C++, if you use a pointer in a dynamic_cast() and it fails, the result is a null pointer. However, since you cannot have a null reference, dynamic casts need to be wrapped in try/catch blocks.
Check out your Company Bowl for anonymous work chats.