'How to separate a two digit hexadecimal number into its digits?
Suppose I have a hexadecimal number 4e. How to get 4 and e separately and store it in two separate variables?
Solution 1:[1]
if you mean 'how can I get the upper and lower nibbles of a byte into two variables'
char x = 0x4e;
int low = x & 0x0f;
int high = (x & 0xf0) >> 4;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | pm100 |
