"Joe Malone" <[EMAIL PROTECTED]> wrote in message
news:87266@palm-dev-forum...
>
> --- bill <[EMAIL PROTECTED]> wrote:
> > Something else I noticed: 'UInt16' and 'int' is there any
> > differance in these two, I thought there was?
> > ...
> > If there isn't a difference, why not just use 'int'??
>
> See my answer below. But first, some caveats:
>
> <caveats>
> I am not an expert in C. I have not recently read the ANSI standards.
> I did not have any input into or effect upon Palm (now "PalmSource"),
> Inc's decision to add size indicators to data type names.
> </caveats>
>
> In the original edition of K&R's "The C Programming Language", int is
> described as "an integer, typically reflecting the natural size of
> integers on the host machine." Examples are given for machines upon
> which an int is 16, 32, and 36 bits. In contrast, I think you can
> expect a UInt16 to be 16 bits, regardless of the machine you use to
> compile your code.
>
> See also
> http://oasis.palm.com/dev/kb/faq/2409.cfm
>
> and, you might find this interesting reading:
> http://oasis.palm.com/dev/kb/papers/1710.cfm
>
Why is this significant? I am not certain, but I strongly suspect
that the StrongArm is a 32-bit processor, so an "int" is very likely
to be 32 bits there. All of your databases defined using "int" are
going to have a different format if this is the case. Those defined
using Int16 will definately be 16 bits. (Of course, the same could
also be ensured by using "short" instead of "int" ...)
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi/sec: not just a good idea, it's the LAW!
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/