'#' conversion flag in printf() doesn't work with NULL character
From: Erik Leunissen (look_at_the.footer.invalid)
Date: 02/23/05
- Next message: Michael Mair: "Re: typedef declares object / enum to int"
- Previous message: Mark F. Haigh: "Re: number of machine instructions - for algorithm measuring"
- Next in thread: Walter Roberson: "Re: '#' conversion flag in printf() doesn't work with NULL character"
- Reply: Walter Roberson: "Re: '#' conversion flag in printf() doesn't work with NULL character"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Feb 2005 18:44:37 +0100
L.S.
I've observed unexpected behaviour regarding the usage of the '#' flag
in the conversion specification in the printf() family of functions. Did
I detect a bug, or is there something wrong with my expectations
regarding the effect of the following code:
printf("NULL as hex: %#4.2x\n", '\0');
Expected output
===============
NULL as hex: 0x00
Observed output (white space is significant)
===============
NULL as hex: 00
Thanks in advance for any comments,
Erik Leunissen
==============
-- leunissen@ nl | Merge the left part of these two lines into one, e. hccnet. | respecting a character's position in a line.
- Next message: Michael Mair: "Re: typedef declares object / enum to int"
- Previous message: Mark F. Haigh: "Re: number of machine instructions - for algorithm measuring"
- Next in thread: Walter Roberson: "Re: '#' conversion flag in printf() doesn't work with NULL character"
- Reply: Walter Roberson: "Re: '#' conversion flag in printf() doesn't work with NULL character"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|