Hi I have to convert std::string into std::vector<unsigned char>
. Let's assume string which contains 14 characters: 020000040800F2 and vector v
should contains 7 values. In the real program string will be a little bit longer.
std::vector<unsigned char> v(7);
v[0] = 2; // 02
v[1] = 0; // 00
v[2] = 0; // 00
v[3] = 4; // 04
v[4] = 8; // 08
v[5] = 0; // 00
v[6] = 242; //F2
I am writing in C++17. I was looking for known solutions in algorithm but there are not which could help me. Thank you so much guys for your help.