![]() |
Simple question regarding splitting up a Hex number into a buffer
Hello,
I’m new to this forum and fairly new to programming. I have a hexadecimal number that I wish to put into a buffer so I can display the 2 least significant bits, that is the two last digits. i.e the number look like this unsigned short = 0xFE18 but I’d like to display on the screen just “18”. Which is the best way to do this? Thanks you so very much! /Pamela |
Re: Simple question regarding splitting up a Hex number into a buffer
Welcome to G4EF, Pamela :)
Don't know, if this is the best, bu you can do it this way: (1) Print the hex number to a string: Code: C
Code: C
Complete test program: Code: C
|
Re: Simple question regarding splitting up a Hex number into a buffer
Thank you so much! :happy:
/pamela |
Re: Simple question regarding splitting up a Hex number into a buffer
My pleasure :)
|
Re: Simple question regarding splitting up a Hex number into a buffer
pamela :) put this smiley in yahoo IM to see what it is " :X :-*" :)
|
| All times are GMT +5.5. The time now is 09:29. |