Convert string vector to byte vector
int convert_string_vector_to_byte_vector( const vector<string> & vs, vector<byte> & vn, int nNoNumericReplace = 0 )
the number of converted items
EX1
int convert_string_vector_to_byte_vector_ex1() { vector<string> vs = {"255", "17", "253", "128", "--"}; vector<byte> vn; int nRet = convert_string_vector_to_byte_vector(vs , vn , 0); if(nRet) { printf("%d items converted :\n" , nRet);//Output as Hex: 5 items converted : //ff 11 fd 80 0 for (int ii=0; ii < nRet; ii++) printf("%02x ", vn[ii]); printf("\n"); } else printf("Convert failed"); return 0; }
convert_str_vector_to_num_vector, convert_string_vector_to_int_vector , convert_byte_vector_to_string_vector
origin.h