max size for printf() format conversion?
- From: Matt Garman <fake@xxxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 19:57:40 GMT
Is there a clean, portable way to determine the maximum value of
converted numerical fields with printf()-like functions? Doing this
at compile-time would be preferable.
For example, %i should never convert to a string that is longer than
the number of digits in INT_MAX, right?
I'd like to create a structure that contains character
representations of numerical types (e.g., instead of storing 3421 as
an int, it would store the char array "3421"). I'd like to make
these fields a fixed-size static array, but obviously I don't want
to make them too small.
Thanks!
Matt
--
Matt Garman
email at: http://raw-sewage.net/index.php?file=email
.
- Follow-Ups:
- Re: max size for printf() format conversion?
- From: Michael Mair
- Re: max size for printf() format conversion?
- From: Jens . Toerring
- Re: max size for printf() format conversion?
- Prev by Date: Re: Some pointer quiestions again
- Next by Date: Re: sscanf and int64 in Win32 and Unix - different results?
- Previous by thread: message buffering for logs, sprintf, etc...
- Next by thread: Re: max size for printf() format conversion?
- Index(es):
Relevant Pages
|