Re: Curious question for act.comm.c

From: Carlos Myers (farix@stargate.net)
Date: 09/01/01


From: "Del" <caminturn@earthlink.net>
> Artovil wrote:
> > >In this function, where is buf1 and buf2 comming from? (are they not
globals
> > >here?) Or am I missing somthing to understand what you're refering to?
> >
> > buf1 and buf2 are coming from the prompt, the player types write paper
pen,
> > where paper = buf1, and pen = buf2, and to clarify that inside the
function
> > they are set papername = buf1, penname = buf2, and so forth.
> >
>
> HUH??
>
> Where are you getting buf1 and buf2 from? The 'argument' is passed to
> ACMD(do_write) not buf1 and buf2, penname and papername are then set to
buf1
> and buf2. Directly after it, they are being RESET to the two_arguments.
> Why?

Penname and papername are pointers that reference buf1 and buf2.  In other
words, they don't copy the data in buf1 and buf2, but do point to where buf1
and buf2 are located in memory.  They then pass the reference to
two_arguments, which manipulates buf1 and buf2 directly.

Carlos

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



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