On Wed, 31 Jan 2001 01:57:05 +0000, Igor Mozolevsky
<[EMAIL PROTECTED]> wrote:

>
>At 17:11 30/01/2001 -0800, you wrote:
>char S[10];
>char SS[10];
>char SSS[10];
>
...
>
>  (unsigned int) (SS[0]) = (S[0]-'0');
>

This line is wrong.  The cast on the left hand side doesn't do
anything.  ss[0] is still a char type.  When you cast ss[0] to
unsigned int, the compiler would either just ignore it or put the
result of the cast to a temporary unsigned int variable and then this
temporary variable is thrown away.  Most people do casting on the
right hand side.  That is:

unsigned int result;
result = (unsigned int) (s[0] - '0');

Remember, char type is nothing more than just a 1 byte integer.

John Leung.
jleung at direct dot ca

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

Reply via email to