bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about (s)printf formatting


From: Johan Lindh
Subject: Question about (s)printf formatting
Date: Tue, 03 Dec 2002 11:53:44 +0100

Hi all!
This is not a bug, but the web page said questions should be directed here, 
so...

I'm a bit confused about the expected behaviour of printf() and it's friends.
When running the following...

printf( "%#.0o\n", 0 );
printf( "%#.0x\n", 0 );

I get the output

0\n
\n

(Graphic newlines inserted for clarity).

Why do they print differently?
If the zero value is hidden as it should be with a precision of zero,
why does the octal prefix show up, but not the hex?

Is there a specification for how printf() etc should work available on the net?

PS, I'm not subscribed to the list (as I could not find instructions on how to 
do so),
so please CC any replies to me.

Regards,

Johan Lindh






reply via email to

[Prev in Thread] Current Thread [Next in Thread]