<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 11/20/2012 09:21 AM, Jerry Feldman
      wrote:<br>
    </div>
    <blockquote cite="mid:50AB9200.1070303@blu.org" type="cite">
      <pre wrap="">On 11/20/2012 06:12 AM, Mark Woodward wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 11/20/2012 01:55 AM, David Kramer wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">
You probably want sprintf, which is like printf except it outputs a
string instead of writing the output to stdout.

<a class="moz-txt-link-freetext" href="http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/">http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/</a>
</pre>
        </blockquote>
        <pre wrap="">
You never, ever, really never, want to use sprintf in any program.
Each and every occurrence of "sprintf" should be replaced by snprintf
as soon as possible. The sprintf call is unbounded is a stability risk
as well as a potential security hole.
</pre>
      </blockquote>
      <pre wrap="">C++ native strings are identical to C language strings using all the C
library functions, but there is a very rich C++ string class that is
part of the STL (standard template Library)(std::string).
<a class="moz-txt-link-freetext" href="http://www.cplusplus.com/reference/string/string/">http://www.cplusplus.com/reference/string/string/</a>

IMHO, as a long time contractor I always recommend coding in the same
style that is prevalent in the companies that I have worked in. When
coding in C++ I rarely use the C language strings or printfs. Again,
from a purist standpoint, in C++ you should generally use the cout set
of input/output operators.</pre>
    </blockquote>
    <br>
    This is a pet peeve of mine. What is a C++ "purist?" C++ is a very
    broad language with a lot of capabilities. The "cout" object is
    merely one of those to be used or not based on need.<br>
    <br>
    For some reason, "purists" want to ignore that C++ is for all
    practical purposes a set of extensions to C. Furthermore, that, for
    some reason, programs must be coded entirely differently than you
    would C code. I reject this mentality as something akin to
    "java-envy" or something.<br>
    <br>
    There is nothing wrong with the various incarnations of printf.
    There is no reason not to use malloc if you want. There is no reason
    not to use "char *" for strings. Templates need not be used. <br>
    <br>
    C++ code is that which compiles using a C++ compiler, not some
    ideological construct that must be adhered too. <br>
    <blockquote cite="mid:50AB9200.1070303@blu.org" type="cite">
      <pre wrap="">

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Hardwarehacking mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Hardwarehacking@blu.org">Hardwarehacking@blu.org</a>
<a class="moz-txt-link-freetext" href="http://lists.blu.org/mailman/listinfo/hardwarehacking">http://lists.blu.org/mailman/listinfo/hardwarehacking</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>