i not too sure if it is possible to do this
eventhough in the followin function it is returning a vector "ret"
i would like to get both "ret" and "pee" values from the split function into the main funtion.
std::vector<int> split( string& s)
{
int pee = 0 ;
int q = 0;
std::vector<int > ret;
typedef string::size_type string_size;
string_size i = 0;
while ( i != s.size() ) {
while ( i != s.size() && isspace(s) )
++i;
string_size j = i;
while ( j != s.size() && !isspace(s[j]) ){
++j;
if ( i != j ) {
stringstream ss(stringstream::in | stringstream:ut);
ss<<s.substr(i, j-1);
ss>>q ;
if( q != 0){
ret.push_back(q);
}
else break;
}}
pee++ ;
i = j;
}
return ret ;
}
int main(){
....code
std::vector<int>words = split(tt) ;
// would get value of "pee" from "split" function
}
THANKS ALOT in ADVANCE
eventhough in the followin function it is returning a vector "ret"
i would like to get both "ret" and "pee" values from the split function into the main funtion.
std::vector<int> split( string& s)
{
int pee = 0 ;
int q = 0;
std::vector<int > ret;
typedef string::size_type string_size;
string_size i = 0;
while ( i != s.size() ) {
while ( i != s.size() && isspace(s) )
++i;
string_size j = i;
while ( j != s.size() && !isspace(s[j]) ){
++j;
if ( i != j ) {
stringstream ss(stringstream::in | stringstream:ut);
ss<<s.substr(i, j-1);
ss>>q ;
if( q != 0){
ret.push_back(q);
}
else break;
}}
pee++ ;
i = j;
}
return ret ;
}
int main(){
....code
std::vector<int>words = split(tt) ;
// would get value of "pee" from "split" function
}
THANKS ALOT in ADVANCE