2.1.6.9 convert_int_vector_to_string_vector


Description

convert int vector to string vector

Syntax

int convert_int_vector_to_string_vector( const vector<int> & vn, vector<string> & vs )

Parameters

vn
[input] int array want to convert
vs
[output] string array wanted

Return

the number of converted items

Examples

EX1

void convert_int_vector_to_string_vector_ex1()
{
    vector<string> strVec;
    vector<int> nVec = {1,0,3.123,-2,10,255,1024,8};
    int nRet = convert_int_vector_to_string_vector(nVec, strVec);
    if(nRet)
    {
        printf("%d items converted :\n" , nRet); 
        for(int ii = 0; ii < strVec.GetSize() ; ii++)
            printf("%s\t" , strVec[ii]);
        printf("\n");
    } 
    else 
        printf("Convert failed");
}


Remark

See Also

convert_string_vector_to_int_vector

Header to Include

origin.h

Reference