02-12-2005, 05:47 PM
If the long value is in the range that can be represented by the byte it is the coresponding value. I have to look up what happens otherwise, but I think it's undefined behavior.
If you want to reinterpret the value, you'd have to use
"*(unsigned char*)(&long_source)" in C and "reinterpret_cast<unsigned char&>(long_source)" in C++. But something like that is rarly used.
If you want to reinterpret the value, you'd have to use
"*(unsigned char*)(&long_source)" in C and "reinterpret_cast<unsigned char&>(long_source)" in C++. But something like that is rarly used.