String into array two signs at once

Is there any way to write string like this: 00112233445566778899aabbccddeeff as an array like this:

 
unsigned char array[16]= {0x00 ,0x11 ,0x22 ,0x33 ,0x44 ,0x55 ,0x66 ,0x77 ,0x88 ,0x99 ,0xaa ,0xbb ,0xcc ,0xdd ,0xee ,0xff};

?

It has to be unsigned char array.
Yes.

Separate your string into substrings two characters long, apply std::stoi(str, nullptr, 16) to each and cast results in unsigned char.
How do I separate it?
Use substring member function http://en.cppreference.com/w/cpp/string/basic_string/substr
or
Manually copy each pair of symbols in temporary buffer
or
Insert '\0' character between each pair and do some obscure math
or
Think about your own method
Last edited on
Thank you :)
Topic archived. No new replies allowed.