title: Reading from a buffer word by word in c
body: <p>I have a Buffer received as a result of recvfrom(). lets say, </p>
  
  <blockquote>
    <p>char buffer[12] = "Hello 1";</p>
  </blockquote>
  
  <p>I want to separate Hello and 1 and store them in different buffers so that one buffer has "Hello" in it and other buffer or an int variable has "1" stored in it.</p>
  
  <p>In other words I want to separate contents of a buffer on the basis of spaces. How can this be done?</p>
  
  <p>I tried:</p>
  
  <pre><code>int number;
  char buff[7];
  sscanf (buffer,"%s %d",buff,number);
  </code></pre>
  
  <p>Will this approach work?</p>