Thanks for all the help. It turns out that this point from Matthew,

 "By shallow I mean it copies the data exactly (it copies the pointers
inside the structure, not the data the pointers point to.)"

was my underlying problem, not the difference between the dereferencing copy
operation and MemMove.

"David Eyler" <[EMAIL PROTECTED]> wrote in message
news:105426@palm-dev-forum...
>
> Until just now I had thought that the two operations below were identical.
> A bug I just found in my code made me realize that they're not. Is there a
C
> wiz out there that could explain the difference? Thanks so much.  The
> Char*'s point into the dynamic heap, where they have been allocated with
> MemPtrNew, and then they are written into the packed record later when the
> record is closed.
>
> typedef struct FlightDB {
>  UInt32 trip;
>  MemHandle packedH;
> ...
>  Char* from;
>  Char* to;
>  } FlightDB;
>
> FlightDB* fRecPOne;
> FlightDB* fRecPTwo;
>
> Op #1:  *fRecPOne = *fRecPTwo;
>
> Op #2:  MemMove(fRecPOne, fRecPTwo, sizeof(FlightDB));
>
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to