Praetorian said:
So the printing as ints worked but hex didn't? I have no idea why this
would happen, you can try cast the result of each masking operation as
an int once again but I doubt this will fix it.
Sorry, but "try a cast, but I doubt that it will fix it" is bad advice.
All casts should be viewed with suspicion. A cast is often used to
tell the compiler, "I know what I'm doing; don't bother me with
warnings"; if you *don't* know what you're doing, you're very likely
to shoot yourself in the foot. (The classic example is casting the
result of malloc() to disable a warning caused by a missing
"#include <stdlib.h".)
We need to see the OP's actual code before we can offer any advice;
trying to guess what "it doesn't work" really means won't do any good.
(If the OP doesn't come back and tell us what he meant, we can assume
he didn't really need or want any help.)