In my program one of my function returns a vector<int> ... I want to save it in to a vector<string>.
itoa function does not seem to work here. Is there anything that can be done regarding this.
Thanks in Advance.
I would imagine you could create a vector of char*. Go through your vector of integers, use itoa on each individual integer to create a string, then push that new string onto your vector. Note that itoa converts to a char*, not a C++-style string. itoa wouldn't work on an entire vector directly. You have to convert the elements one by one and push them onto the new vector of type char*. If you want a vector of C++-style strings instead, you'd have to then create one from the char* returned by itoa for each element of the integer vector.