Files
developer-roadmap/roadmaps/cpp/content/dynamic_cast@4BdFcuQ5KNW94cu2jz-vE.md
T
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

541 B

Dynamic Cast

dynamic_cast is a C++ casting operator primarily used within polymorphic class hierarchies to safely convert pointers or references from a base class to a derived class. Unlike static casts, it performs a runtime check to ensure the validity of the conversion. If the object being cast is not actually an instance of the target derived class, dynamic_cast returns a null pointer (for pointer casts) or throws a std::bad_cast exception (for reference casts), preventing undefined behavior and enabling safer downcasting.