ansi printf questions

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Feb 4 20:16:00 AEST 1989


In article <15159 at oberon.USC.EDU> blarson at skat.usc.edu (Bob Larson) writes:
>How does %i differ from %d?

Is there a %i?  I don't have the proposed Standard at hand but I don't
recall a %i format.  I'll look this up and if nobody else responds by
the time I find out, I'll let you know what %i is supposed to do.

>u, o, x, and X formats take an int and print it unsigned.  Shouldn't
>they take an unsigned int?  Is there a difference on any known machine?

Unsigned int is (now) required to be passed in exactly the same format
as plain int, so it doesn't matter from the viewpoint of implementing
printf().  It does matter from the viewpoint of the USER of printf(),
and this has been fixed in the latest edition of the proposed Standard.



More information about the Comp.std.c mailing list