You are using the wrong flag. The expression in second is long long.
So you should use flag "%llx". Since printf uses vararg, it is
undefined behavior if there is type mismatch with argument.

Hong

> Hehehe.  Ok.  Guess what the following will print:
> 
> #include <stdio.h>
> int main(void) {
>     int x = 511;
>     printf("x = %x\n", x);
>     printf("x & ~0xff = %x\n", x & (long long) ~0xff);
>     return 0;
> }
> 
> 
> -- 
>     Andy Dougherty            [EMAIL PROTECTED]
>     Dept. of Physics
>     Lafayette College, Easton PA 18042
> 
> 
> 

Reply via email to