David Eyler wrote:
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.
sorry, could someone explain this to me. I'm trying to understand this but it sounds like you're saying that MemMove() would copy the data that the pointers _inside the structure_ point to? Am I understanding this right? this seems pretty unlikely. can someone explain the difference between the two a little further including the difference between a shallow copy and a deep(?) copy?

thanks,
Matt




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