title: C - ignoring whitespace with sscanf
body: <p>I've been trying to figure this out, and I sort of have a work around but I just wanted to check that I'm not missing something obvious. Basically, I have a series of commands that follow certain rules. Anything containing a digit, ASCII letter, or certain symbols is a token and &lt;,>,|,&amp;&amp;,;,etc are delimiters. I need to be able to tell which one I just found and store them in an array. </p>
  
  <p>So in a while loop I have</p>
  
  <pre><code>a = sscanf (cp, "%[0-9a-zA-Z!@:/-.,^+% ]", str);
  </code></pre>
  
  <p>I've included a space as one of the symbols to look for since I couldn't figure out any other way. Instead, after I get the word (plus nay possible spaces) I call</p>
  
  <pre><code> delimiters[] = " ";
   token = strtok(str, delimiters);
  </code></pre>
  
  <p>Which should remove the whitespace, leaving me with just a token (and if there was no space, it just doesn't change the word). I'm just curious if there's a way to do something similar with sscanf, since I know that it already breaks up strings if there's a whitespace between them, but if you call it again and it sees the whitespace, it just doesn't read anything.</p>
  
  <p>If not, that's fine too. It's just been bugging my all day.</p>