4 ms·
> casting to char and then to int-type to inspect multiple bytes is fine as long as alignment plays correctly It is only fine if there were the same exact int
by gpderetta 7y ago
> casting to char and then to int-type to inspect multiple bytes is fine as long as alignment plays correctly
It is only fine if there were the same exact int types at that address. Remember, UB usually isn't the reinterpret_cast but the dereference.