--- Mark Biek <[EMAIL PROTECTED]> wrote:
> 
> It looks like even though the size of a UrlRecord is the 
> same between the two apps, doing "p += sizeof(UrlRecord)" 
> actually increments the pointer too far.  

Look up "pointer arithmetic" in any book on the C programming language.
 If p is a pointer to some type t, and i is an integer, then p += i
increments p so it points to i elements beyond where it previously
pointed.  The compiler uses the size of t to determine how much to
increment p.

For example:

UInt16 *p;
UInt16 x;
p = &x;
p += 1;  // adds 2 to p

UInt32 *q;
UInt32 y;
q = &y;
q += 1;  // adds 4 to q


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

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

Reply via email to