title: C++ / C: Trim the first word of each line of a text file
body: <p>I am looking for a C / C++ or even C# code that will trim the first word of a each line in a text file</p>
  
  <p>e.g. file.txt</p>
  
  <pre><code>test C:\Windows\System32\cacl.exe
  download C:\Program Files\MS\
  </code></pre>
  
  <p>So I will be left with:</p>
  
  <pre><code>C:\Windows\System32\cacl.exe
  C:\Program Files\MS\
  </code></pre>
  
  <p>I have the current code, but it doesnt seem to work:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main(int argc, char *argv[])
  {
      char s[2048];
      while (fgets(s, sizeof(s), stdin))
      {
          char *pos = strpbrk(s, "|\r\n");
          if (pos != 0)
              fputs(pos+1, stdout);
      }
      return 0;
  }
  </code></pre>