How do I access individual words after splitting a string?
<pre><code>std::string token, line("This is a sentence.");
std::istringstream iss(line);
getline(iss, token, ' ');

std::cout &lt;&lt; token[0] &lt;&lt; "\n";
</code></pre>

<p>This is printing individual letters. How do I get the complete words?</p>

<p>Updated to add:</p>

<p>I need to access them as words for doing something like this...</p>

<pre><code>if (word[0] == "something")
   do_this();
else
   do_that();
</code></pre>
