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.
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
Just use the function
string IntToString ( int number )
{
std::ostringstream oss;
// Works just like cout
oss<< number;
// Return the underlying string
return oss.str();
}
and include the header file: #include <sstream>
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439