3
I have a vector with four elements that are numbers represented in hexadecimal form.
What I need to do is concatenate these four elements (I believe that this is not the right word, but I have not found a better one)?
For example:
int v[4]={0xA, 0xBB, 0x4B, 0x18};
I need a result that is similar to:
int resultado=0xABB4B18;
The first
printf
should be zeroed (at least for bytes from the second):printf(i?"%02X":"%X", v[i]);
– pmg
@pmg indeed both could have this formatting, is done.
– Maniero