dynamic_cast: It is used for converting pointers/references within an inheritance hierarchy.
static_cast: It is used for ordinary type conversions.
reinterpret_cast: reinterpret_cast converts any pointer type to any other pointer type, even of unrelated classes. The operation result is a simple binary copy of the value from one pointer to the other. All pointer conversions are allowed: neither the content pointed nor the pointer type itself is checked..Use with extreme caution.
const_cast: It is used for casting away const/volatile. Avoid this unless you are stuck using a const-incorrect API.
Answer:
dynamic_cast: It is used for converting pointers/references within an inheritance hierarchy.
static_cast: It is used for ordinary type conversions.
reinterpret_cast: reinterpret_cast converts any pointer type to any other pointer type, even of unrelated classes. The operation result is a simple binary copy of the value from one pointer to the other. All pointer conversions are allowed: neither the content pointed nor the pointer type itself is checked..Use with extreme caution.
const_cast: It is used for casting away const/volatile. Avoid this unless you are stuck using a const-incorrect API.
need an explanation for this answer? contact us directly to get an explanation for this answer