In article <57606@palm-dev-forum>, [EMAIL PROTECTED] says...
>
> Hello all!
>
> Is there any function to convert a Char* that contains a Hexadecimal
> ASCII to an Int32? There is a function
> Char* StrIToH (Char* s, UInt32 i)
> which converts an integer to hexadecimal ASCII. I saw there is no
> function
> Int32 StrHToI (const Char* str)
> but is there another way to do it?
>
> Thanks!
> Leonardo Holanda
> (Brazil)
>
Should be pretty easy to code yourself...
int i = 0;
int idx = 0;
while (str[idx] != '\0')
{
char c = str[idx++];
i = i << 4;
if (c < 0x40) { i &= c & 0xF; }
else { i &= (c & 0xF) + 9 }
}
That's uncompiled, untested, etc, but should be close if it doesn't work.
Hope that helps,
-Thomee-
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/