Re: What does this do:

From: Carlo Mocci (mocci@TIN.IT)
Date: 10/05/98


At 01.09 05/10/98 , you wrote:
>On Tue, 6 Oct 1998, Chuck Carson wrote:
>
>>I am reting to figure out what this does, I have 4 books on C in which
>>none of them discuss this:
>>
>>sprintf(buf + strlen(buf), "blah........
>
>It's basically a strcatprintf().
>
>And no that function doesn't exist, I'm just illustrating what it does. :)
>
I think it was introduced in place of using
sprintf(buf, "%sThis is another line, number %d\r\n", buf, number);

The command above will work on linux, but not on Borland compiler, because
the latter cleans buf before writing to it. IE sprintf behaviour is
undefined when writing a string over itself.


Carlo Mocci - mocci@tin.it

Kabir
Coder of Dalila MUD
dalila.shopitaly.net 4000


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST