So I'm trying to create a function that will extract a word from a string. I'm trying to do this without creating an array. So far I have this:

string s = "Hello World";
string t;
for (size_t k = 0; k!=s.size(); k++)
{if (isalpha(s[k]))
t+=s[k];
else
???;
}
cout << t << endl;

Basically I'm wondering what to put in the ??? part....