|
|
jacob navia wrote:
Keith Thompson wrote:
I think I know what you *meant*, but what you actually *wrote* was
less than accurate on two counts. First, the expected argument
is an int (you clearly said it isn't). Second, the argument is
typically going to be within the range of unsigned char, not of
necessarily of plain char (though there's no prohibition on values
outside the range of unsigned char). For example, on a system with
8-bit signed plain char, there's nothing wrong or even unexpected
about ``printf("%c", 255)'' (except that I'd probably use putchar()).
printf("%c",12345678);
will not!
Actually, the behavior is well defined (if and only if 12345678
is within the range of type int). The int value is converted to
unsigned char and the resulting character is written. Assuming
UCHAR_MAX==255, the result is 78; on an ASCII-based system, this
will print 'N'. (I reached that conclusion by reading the code
and consulting the standard; a quick experiment confirmed it.)
You could say it doesn't "work" in the sense that it doesn't print
anything particularly meaningful.
Before you accuse me of playing "word games", consider that words are
the only tool we have here. You wrote that "the expected argument
is a char"; I can't think of any reasonable interpretation by which
that statement is factually correct.
Well OK
"%c" format specifier expects an int.
GREAT!
I am tired of this discussion. You are right, I was wrong
and when everybody uses "%c" to put a character they are
totally wrong.
Jacob, Keith was perfectly civil to you. You made a mistake, and he felt
it important to point it out - not to prove you wrong, but to be
strictly correct and to ensure noone was confused by your erroneous
statement.
You are not the only one who makes mistakes and gets corrected here. For
example, Richard Heathfield makes mistakes, and his mistakes are
corrected in exactly the same manner. See
<slrnfupu92.bit.willem@xxxxxxxxxxxxxx> from just yesterday. I don't see
why you need to take polite corrections so personally. Where others say
"oh yes, how silly of me, thank you for the correction" you complain of
personal vendettas and word games. I especially can't understand it when
the correction comes from someone as calm and civil as Keith.
As I've said before, I would much rather you were part of clc than not
part of it; you certainly have made contributions to clc and C itself.
However your passive-aggressive behaviour is a detriment to your
character, and all the noise dilutes your relevant contributions.
Philip
|
|