Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qick Conversion Question -- Please Help

Status
Not open for further replies.

DougCa

Technical User
Nov 1, 2002
13
0
0
US
Hi:

I have this function, converting the ASCII value in to a corresponding HEX and then doing a bitshift by 4. It does octal.


iReturnValue = (iReturnValue <<= 4) | ( (cmd % '0') - 7 * (cmd / 'A') );

if I want to change this to convert from to an integer from hexascii what needs to be changed?

iReturnValue = (iReturnValue >>= 4) | ( (cmd % '0') - 7 * (cmd / 'A') );

I thought this above, but it does not seem to work.

Thanks,
Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top