[Please do not mail me a copy of your followup]
sl...@pacbell.net spake the secret code
<u7Qny.117728$Sn4.1...@fx44.iad> thusly:
>Christopher Pisz <
nos...@notanaddress.com> writes:
>
>>Where am I going wrong?
>
> You should be using snprintf :-)
Yet your own example gets it wrong, which just serves to demonstrate
why using printf-style functions is error-prone.
Just the other day I found yet-another-occurrence of a printf-style
varargs function being passed an object instead of a primitive type
for a log message. The code compiled just fine, but of course results
in absolute garbage when executed.
I prefer mechanisms that fail at compile time when I write something
non-sensical.
(Yes, I know some more modern compilers can be configured to warn or
error at such things. Do you know why? Because it is so easy to use
this construct incorrectly that they attempt to compensate for it.
This again just serves to demonstrate why it should be avoided.)
--
"The Direct3D Graphics Pipeline" free book <
http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <
http://computergraphicsmuseum.org>
The Terminals Wiki <
http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <
http://legalizeadulthood.wordpress.com>