
Corbin P. answered 08/22/20
4th Year Computer Engineering Student
If you accidentally have different types, static_cast will generate an error during compile time rather than runtime like in a C-style cast.
In my opinion, the biggest reason why static_cast is preferred is for readability, since "static_cast<int>(x)" stands out a lot more than "(int)x".