Removing a space from lines in the beginning of a text file
<p>I have a C++ snippet that removes the first word of a line in a text file e.g.</p>

<pre><code>test C:\Windows\System32
download C:\Program Files\test.exe
</code></pre>

<p>Although it removes the first word, there is a space left over after trimming it, is there a way to stop remove this space?</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
   string tmp;
   while ( !cin.eof() )
   {
      cin &gt;&gt; tmp;
      getline(cin, tmp);
      cout &lt;&lt; tmp &lt;&lt; endl;
   }
}
</code></pre>
