Here is some code that will work. It is not as simple as calling one function.
std::string str = "first middle last";
unsigned int first;
unsinged int last;
first = str.find(' ');
last = str.rfind(' ');
std::copy(str.begin()+first+1, str.begin()+last,
ostream_iterator<int>(cout));
Hope that makes sense...
The copy sends the chars to cout. It starts from m and ends right before the space. find gets the ' ' starting from the beginning. r find gets the ' ' starting from the end.
-Skatanic
-Skatanic