Re: Who MOTD

From: Pj Bean (
Date: 11/08/01

Four infractions:
>1) Global variable will be for _everybody_, not just one person.  You want
    the pointer in 'struct char_data' or 'struct descriptor_data'.
*cough* umm not exactly, He wants to define one GLOBAL whomessage for
He has it right Just he needs to use
char whomessage;
char whomessage[50];

>2) You want 'whomessage', not '*whomessage'.  You're assigning a pointer,
    not writing to what the pointer goes to.
Hes right on this one ...but he doesnt explain this quite well,
whomessage = str_dup("");
// they support str_dup in circle ?
//if not comment that out we dont neccessarily have to
//give mem to characters ...only big ones to keep it stable
whomessage = buf;
send_to_char("Who message set.\n\r",ch);
Now you can use any of those assignments ...whichever compiles or fits your
fiddle, its real late right now so im not TOTALLY clear headed

>3) You need to allocate memory for that string.  'arg' is a magical global
    buffer that is used for many different functions.
I've never had to ...but use buf instead, its usually already sizable enough
for it.

>4) Failure to grasp C.  (To put it bluntly.)  Best solution there is a good
    C book and a lot of quiet reading.  It'll make more sense then.
its not a failure ...its called being a newbie, maybe he hasnt read a book
....thats pretty good for a newbie still...i remember back in the day when i
thought colorizing the who was the ultimate thing to do, ...there are alot
of informative tutorials in basic c online tho, try or some
of links darkhoths page and greyhtons, but alas ....he is
right will make ALOT more sense :)

Anyways just my 2 cents

Get your FREE download of MSN Explorer at

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST