I have a string x that I need to convert into a hex format:
char x[5];
x[0]='0';
x[1]='1';
x[2]='0';
x[3]='1'; //x contains value of 0xA or decimal 10;
x[4]='\0';
Now how can I convert this and store it into an unsigned integer variable so the variable would be of value 0xA;
Thanks.
It seems that the number is stored in reversed direction, which is not natural for human to read, but quite a natural way to represent number as the index refers to the power of 2 that should be applied.
There is no existing library to do the conversion for you, you need to write code to parse it yourself: