title: Parsing a line in C
body: <p>I have a file, in which each line contains several words that are separated by variable amount of whitespace characters (spaces and tabs). For example:</p>
  
  <pre><code>do that param1   param2  param3
  do   this   param1
  </code></pre>
  
  <p>(The number of words in a line is unknown in advance and is unbounded)</p>
  
  <p>I'm looking for a way to parse such a line in plain C, so that I'll have a pointer to string containing the first word, a pointer to a string containing the second word, and a pointer to a string containing everything else (that is - all of the line, except the first two words). The idea is that the "rest of the line" string will be further parsed by a callback function, determined by the first two words).</p>
  
  <p>Getting the first two words is easy enough (a simple <code>sscanf</code>), but I have no idea how to get the "rest of the line" pointer (As <code>sscanf</code> stops at whitespace, and I don't know the amount of whitespace before the first word, and between the first and the second word).</p>
  
  <p>Any idea will be greatly appreciated.</p>