Re: [CODE] [Newbie] format arguments, %d vs. %s.

From: Ron Cole (
Date: 11/14/98

>Alright, here's the problem... I generally had the %d below as a %s, but that
>would error ( warning: format argument is not a pointer (arg 3) ) , and crash
>the mud if anybody ever Look'ed into a room.
>In act.informative.c...
>  sprintf(buf2," covered in %d's paintballs!\r\n",GET_PAINTBALL(i));
>    send_to_char(buf2, ch);
>So I replaced it with a %d, and now I get a number:
>Catherine the Grape is standing here.
> covered in 136's paintballs!

What is the value?  Is it a char_data pointer? (bad idea, they get extracted)
Or, is it a player id number?  If so, you need to call get_name_by_id() to
retrieve the name.


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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