|
|
In article <fsinv9$v6h$1@xxxxxxxx>, jacob navia <jacob@xxxxxxxxxx> wrote:
>>> The %c format expects
>>> (and thus treats the corresponding argument as) an unsigned char.
>> No standard library functions are described
>> as taking an argument lower ranking than int.
>Yes, but the character is promoted to int only for passing it
>to printf. The expected argument is a char, not an int
It's often true that the argument is a char which gets promoted to
int, but that's not required - the standard says int, not char - and
it's often not a char. It's perfectly normal to store characters in
an int (consider the value returned by getchar() for example), and
of course character constants are ints not chars.
On the other hand, I think it's true that the only reason it's an
int is because of the deafult promotions. If it weren't for that,
it would make more sense for it to be an unsigned char.
-- Richard
--
:wq
|
|