static_cast performs a compile-time checked conversion between compatible data types. It is the C++-style choice for ordinary conversions, such as truncating a double to an integer, while rejecting incompatible conversions. section 5.6
Replacing an unsafe C-style cast
A C-style cast can hide what conversion is intended. In the cleaned-up example, static_cast<double>(n) makes the numeric conversion explicit, while static_cast<double*>(msg) is rejected because the pointer types are incompatible. Use static_cast only when the conversion is as safe as you understand it to be. section 5.6
