This is exact copy from tutorial, Why exception isn't thrown / displayed ? I don't see it in console output. Maybe because My compiler isn't configured properly for this to work. I am using "RAD Studio XE5
Note from tutorial:
"dynamic_cast requires the Run-Time Type Information (RTTI) to keep track of dynamic
types. Some compilers support this feature as an option which is disabled by default. This must be enabled for
runtime type checking using dynamic_cast to work properly."
Have you actually enabled RTTI (if you're not using G++)? Besides, I don't see any reason why this code would throw an exception. Also, you never "delete" the memory you allocated.