convert string vector to int vector
int convert_string_vector_to_int_vector( const vector<string> & vs, vector<int> & vn, int nNoNumericReplace = -1 )
the number of converted items
EX1
int convert_string_vector_to_int_vector_ex1() { vector<string> vs = {"-2","0","65532","127" ,"255"}; vector<int> vn; int nRet = convert_string_vector_to_int_vector(vs,vn); if(nRet) { printf("%d items converted :\n" , nRet);//Output : 5 items converted :-2 0 65532 127 255 for (int ii=0; ii < nRet; ii++) printf("%d ",vn[ii]); printf("\n"); } else printf("Convert failed"); return 0; }
convert_str_vector_to_num_vector, convert_string_vector_to_byte_vector , convert_int_vector_to_string_vector
origin.h