Re: [C++] ostrstream vs. sprintf

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 02/07/02


On Thu, 7 Feb 2002, Henrik Stuart wrote:

>    Snprintf returning the needed buffer size is _implementation
>    dependant_ afair.  I do not have the most recent version of the C
>    C standard close at hand, [...]

Well, that's okay, since I do.  C99 specifies that snprintf() returns the
number of bytes that would have been necessary, if the buffer had been big
enough.  Meaning that, unsurprisingly, Microsoft is wrong and behind the
standards curve (yet again).  That's certainly not enough to discourage me
from using the standard, and it shouldn't be for anyone else.  There are
already free, correct implementations of snprintf() available that would
make a fine interim solution for such unfortunate souls as must rely on
Microsoft's timeliness.


-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT