Re: sprintf

From: Daniel Koepke (dkoepke@california.com)
Date: 12/06/98


Jourge Fuzz Bush wrote:
>
> This maybe a dumb question ( I've always used old borland c++ 3.0
> for dos) but wouldn't it be:
> sprintf(buf + 5, "Hello);
>
> because the length of hello is five.

No.  The value you're adding to buf is the number of characters to
move ahead in 'buf' before printing, not the length of the string
you're printing.  This should be obvious enough, so I might suggest
an investment in a book on C that covers the idiosyncrasies of
operators on pointers.

-dak


     +------------------------------------------------------------+
     | 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