may be this is what you want ?
cout<< setw(10+token.size()) << token ;
Frage
Basically what I'm trying to do is to distribute spaces equally between words of a given string. This is what I did:
istringstream s("En el infinito y mas alla");
string token;
while( s >> token )
{
cout << token << setw(10);
}
However, this is not working as expected. Anybody know why?
Lösung
may be this is what you want ?
cout<< setw(10+token.size()) << token ;