[..snip..]

So near yet so far ;-) I can see *what* you wanted to do but as you admit, 
there is some confusion in your mind. Here's my two pence (euros?)...

> Op #1:  *fRecPOne = *fRecPTwo;
From memory, what this will do is copy *one byte* from the memory at fRecPTwo 
into the memory starting at fRecPOne. Read it as 'the contents of fRecPOne is 
assigned the contents of fRecPTwo'.

The size of the thing it points at (FlightDB) is only of relevance when doing 
pointer arithmetic. (Anybody, is that correct? I'm a tad rusty, it's 23:14 
here in the UK and I need to go to bed! zzz zzz)

>
> Op #2:  MemMove(fRecPOne, fRecPTwo, sizeof(FlightDB));
This is copying N bytes starting from the memory address in fRecPTwo into the 
memory area starting at fRecPOne. This is a *physical movement of data* from 
one place to another.

Another option which you may or may not have tried is...
    Op #3: fRecPOne = fRecPTwo

...which just makes fRecPOne point at the same bit of memory as fRecPTwo. This 
would *appear* as though the memory had been copied, if that's what you 
wanted but all you have done is 'point' the fRecPOne pointer somewhere else. 
That's why they are called pointers, and no I am not trying to be funny or 
sarcastic here. 8-)

Using C++ you could write your own 'operator=()' that does a complete copy. 
I'm stopping right there before we get into deep copies, shallow copies and 
all the usual malarky about copying objects.

Sean Charles.



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

Reply via email to