1. ## string problem, someone please!!

firstly i want to thank for someone who reply me

my problem is

Code:
```// Join solutions together as string, and brek up after two numbers.

stringstream numbers;

// Insert integer into stringstream
numbers <<numLowerCaseLetter(name)<<sumAscii(name)<<lastValue<<counter<<sum;

// Convert stringstream into string
string str = numbers.str();

for(int i = 0; str[i]; i=i+2)
{
cout<<str.substr(i,2)<<" ";
}```

EXPLANATION OF MY PROBLEM::

output is: 55 20 11 84 18

for the code above, it is to split strings after 2 numbers.
when i enter str[1] it displays only 5. how can i do to make it display 55 when i asked for str[0]?

2. how can i do to make it display 55 when i asked for str[0]?
You can't. str[0] is a char type, which means it only stores one character.

output is: 55 20 11 84 18

for the code above, it is to split strings after 2 numbers.
It appears to have done a pretty good job!

3. >for the code above, it is to split strings after 2 numbers.
Code:
```    for(int i = 0; str[i]; i=i+2)
{
cout<<str.substr(i,2)<<" ";
}```
Code:
```    for(int i = 0; i<str.length(); i=i+2)
{
cout<<str.substr(i,2)<<" ";
}
cout << endl;```
Or maybe:
Code:
```    for(int i = 0; i+1<str.length(); i=i+2)
{
cout<<str.substr(i,2)<<" ";
}
cout << endl;```

4. thanks guyz but tat is not wat my problem is .. thnx all of you ..

5. Code:
```#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main(void)
{
stringstream text("55 20 11 84 18");
string before, after;
for (int i = 0; i < 2; ++i)
{
text >> after;
before += after + ' ';
}
getline(text, after);
cout << "before: " << before << '\n';
cout << "after:  " << after  << '\n';
return 0;
}

/* my output
before: 55 20
after:  11 84 18
*/```