How to print 5 byte integer values?

Posted by lost soul on Stack Overflow See other posts from Stack Overflow or by lost soul
Published on 2010-04-20T06:18:00Z Indexed on 2010/04/20 9:43 UTC
Read the original article Hit count: 180

Filed under:

I've just started reading C and have a question about a macro.
How can I print a 5 byte integer value (that happens to be defined in a macro)? For example:

#define MAX 0xdeadbeaf12
int main(){
printf(" 0x %2x \n", MAX);
}  

This code prints adbeaf12 but not deadbeaf12.

How do I get all the bytes printed?

© Stack Overflow or respective owner

Related posts about c