Tim Astle wrote in message <17130@palm-dev-forum>...
>
><off topic>
>
>> char TempCode[5] = "0000\0";
>
>Correct me if I'm wrong, but don't you assign arrays in this fashion?
>
>// Assuming that the \0 was a NUL terminator
>char TempCode[] = "0000";
>// or
>char TempCode[5] = {'0', '0', '0', '0', '\0'};
>
></off topic>
>
Hmm... that part went right by me. True enough that you
don't need the explicit terminator on the string constant
(and later on in the StrCopy I removed it...) In memory
this would be 0x30 0x30 0x30 0x30 0x00 0x00 (6 bytes)
However, would it cause a problem? Depends upon how
string (char array w/ string constant) initialization is done.
If it's done until the first NUL, then no problem. If it's done
for every char represented in the string + an additional NUL,
then we gots a problem w/ what I typed.
Properly, it would be
char TempCode[5] = "0000";
--
-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/