Question: > 
> **Possible Duplicate:**  
> 
> [Regular cast vs. static\_cast vs. dynamic\_cast](https://stackoverflow.com/questions/28002/regular-cast-vs-staticcast-vs-dynamiccast) 
> 
> 
> 

I don't quite get when to use static cast and when dynamic. Any explanation please?

Answer: 
In some contexts, like this one, "static" refers to compile-time and "dynamic" refers to run-time.

For compile-time checking, use static\_cast (limited to what the compiler knows).
For run-time checking, use dynamic\_cast (limited to classes with RTTI).
For no checking, use reinterpret\_cast.
Dynamic cast requires RTTI and does some magic compared to static cast. static\_cast is just a compile time cast, checks if origin class can be promoted to the casted class by some simple rules as inheritance.

For example, in cases of virtual inheritance only dynamic\_cast can resolve the situation.

Apart, dynamic\_cast will return NULL if the cast is not possible, so you can take a different decision.

In the other hand, dynamic\_cast is slower, as it implies some code being executed, and as said previously, it needs RTTI enabled which increases the size of the binaries.