[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
printf ("%hhd", 0x100);
From: |
Mathieu Lacage |
Subject: |
printf ("%hhd", 0x100); |
Date: |
Thu, 15 Jan 2004 21:57:05 +0100 |
hi,
I believe the following code should generate twice the same output on
any architecture.
#include <stdio.h>
int main (int argc, char *argv[])
{
signed char sc = (signed char) 0x100;
printf ("%hhd\n", sc);
printf ("%hhd\n", 0x100);
return 0;
}
However, on my system, I get the following:
address@hidden stdio-common]$ ./a.out
0
256
address@hidden stdio-common]$
regards,
Mathieu
PS: the web interface to GNATS does not answer.
--
Mathieu Lacage <address@hidden>
- printf ("%hhd", 0x100);,
Mathieu Lacage <=