Eliah Ninyo wrote in message <26309@palm-dev-forum>...
>
>hi Chris,
>
>thanks very much for your help, it've been very helpful.
>
>but i have another Q:
>
>how do i know what number to put in the char [X]?
You have to know how long the strings you intend to store will be.
>does it always has to
>be the actualy long (size) of the input-data plus one (for Null)?
Yes.
>according to this, why did u define the SrvCall to be [10] if it is just
>8 digit long? what is padding? do i always need to add 1 for null and 1
>for paddind?
Padding could be either of two things. A) paranoia, or B) for data
alignment -- some processors require certain types of data to be
on even addresses only, or some other requirement. Usually the
compiler will take care of that for you.
>
>another thing is a C Q:
>if i define a string with the long 0f 8, ( char[8]) doesn't it mean that
>i have 9 cells ( from 0 to 8)?
If you say char[8], you have 8 "cells". Their numbers will be from 0 to 7.
>and doesn't it mean that i don't need to
>add 1 tfor Null because it actualy has one more cell?
You need a "cell" for each byte you intend to store. This includes
the NUL char string terminator. Whether you need to add one to
the 8 given depends upon whether you data will be 8 chars long
(in which case you need 9 cells) or whether your data will be 7
chars long (in which case 8 -- 7+1 -- is proper). I don't know
what your data lengths will be, you have to answer that yourself.
>
--
-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/tech/support/forums/