An 8 bit Int can only hold values up to 127. Casting 128-255 values to an
Int8 results in negative numbers. This is by design. You should cast a
Char to a UInt8, or just reference it directly. ie:
Char s = 'A';
if (s==65) {
// This is true.
}
Get a good book on C.
Alan
"Khurram" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am trying to work on non-printable characters which have integer value
of
> 200 and 194.When i get characters from integers it works fine.But when i
try
> to get Int value from Character , it gives me -ve value.
>
> Mir
> ----- Original Message -----
> From: "Dave Lippincott" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Monday, December 08, 2003 8:23 PM
> Subject: Re: Converting ASCII to Int
>
>
> > There is no reason I can think of why it wouldn't work for any ASCII
> > character, even the 'non-printable' ones. Can you give a couple of
> examples
> > of which characters are not working for you?
> >
> > ----- Original Message -----
> > From: "Khurram" <[EMAIL PROTECTED]>
> > To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> > Sent: Monday, December 10, 2001 8:56 AM
> > Subject: Converting ASCII to Int
> >
> >
> > > Hi,
> > > I want to get integer value of an ascii.Is there any function?
> > > Simple typecasting isnt working for characters other than a - z, A- Z
> and
> > > 0-9.What should i do?
> > >
> > > Regards
> > > Khuram Mir
> > >
> > >
> > > --
> > > For information on using the Palm Developer Forums, or to unsubscribe,
> > please see http://www.palmos.com/dev/support/forums/
> > >
> >
> >
> > --
> > For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/