D
Daniel Pitts
Just for sake of completeness, what does dynamic_cast do with an alreadyJames said:Yes. Don't confuse legal/illegal with succeeded/failed. An
illegal dynamic_cast won't compile. But a legal dynamic_cast
can fail at runtime, in which case, it either returns a null
pointer (pointer cast) or throws an exception (reference cast).
null pointer?
p = 0;
pD = dynamic_cast<Derived *>(p); // exception, sigsegv, or null?