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: 
Use `dynamic_cast` when casting from a base class type to a derived class type. It checks that the object being cast is actually of the derived class type and returns a null pointer if the object is not of the desired type (unless you're casting to a reference type -- then it throws a `bad_cast` exception).

Use `static_cast` if this extra check is not necessary. As Arkaitz said, since `dynamic_cast` performs the extra check, it requires RTTI information and thus has a greater runtime overhead, whereas `static_cast` is performed at compile-time.
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 ! :)