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: 
Static casting is done by the compiler: it treats the result as the target type, no matter what. You do this when you're absolutely sure about the argument being of the target type.

Dynamic casting is done at runtime, and thus requires runtime type information. You do this when you're unsure about the type you have: the cast may fail, which is shown by the return value being null. It can also only be done for pointers and references.
If you are talking about C++. Then static\_cast is not safe type of casting. It can cast to your type but if its wrong it will not throw any error/message. So you will get bad object from that. And the dynamic\_cast is throwing error if the casting failed :) Hope this helps ! :)