I understand that reinterpret_cast
is dangerous, I'm just doing this to test it. I have the following code:
int x = 0;
double y = reinterpret_cast<double>(x);
When I try to compile the program, it gives me an error saying
invalid cast from type 'float' to type 'double
What's going on? I thought reinterpret_cast
was the rogue cast that you could use to convert apples to submarines, why won't this simple cast compile?