Ok most answers on SO say that reinterpret_cast is most dangerous cast, can do whatever..what not.., it can reinterpret bits of one type like another type. So my question is why does static_cast<char>(int(0))
works but reinterpret_cast<char>(int(0))
not? is it due to size difference of argument type and destination value type?
reinterpret_cast<char*>(&Some_double_var)
works.
How does implementation knows which cast works in what cases?
Thanks