The first one just converts the value: int b = x;
is the same as int b = static_cast<int>(x);
.
The second case pretends that there is an int
living at the place where in actual fact the x
lives, and then tries to read that int
. That's outright undefined behaviour. (For example, an int
might occupy more space than a char
, or it might be that the char
lives at an address where no int
can ever live.)