title: Reading a string with spaces with sscanf
body: <p>For a project I'm trying to read an int and a string from a string. The only problem is <code>sscanf()</code> appears to break reading an <code>%s</code> when it sees a space. Is there anyway to get around this limitation? Here's an example of what I'm trying to do:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char** argv) {
      int age;
      char* buffer;
      buffer = malloc(200 * sizeof(char));
      sscanf(&quot;19 cool kid&quot;, &quot;%d %s&quot;, &amp;age, buffer);
  
      printf(&quot;%s is %d years old\n&quot;, buffer, age);
      return 0;
  }
  </code></pre>
  <p>What it prints is: <code>cool is 19 years old</code> where I need <code>cool kid is 19 years old</code>. Does anyone know how to fix this?</p>