Каков наилучший способ преобразования шестнадцатеричной строки переменной длины, например. "01A1"
в массив байтов, содержащий эти данные.
i.e преобразуя это:
std::string = "01A1";
в этот
char* hexArray;
int hexLength;
или
std::vector<char> hexArray;
так что, когда я пишу это в файл и hexdump -C
, я получаю двоичные данные, содержащие 01A1
.