title: sscanf() in C to skip over an integer and read string
body: <p>I have a file that contains data in this form:</p>
  
  <blockquote>
    <p>1 Jake 234 Ruby 98.</p>
  </blockquote>
  
  <p>I want to use <code>sscanf</code> to read only the strings into arrays, so I tried this: </p>
  
  <pre><code>male[i] = malloc(100);
  female[i] = malloc(100);
  
  sscanf(str, "%*d%s%*d%s%*d", &amp;male[i], &amp;female[i]);
  </code></pre>
  
  <p>The problem is that when <code>i = 0</code>, the function skips the first string along with the first integer. So when I try to print <code>&amp;male[0]</code>, I get a blank space.</p>
  
  <p>I have initialised <code>i</code> to be <code>0</code>. Could someone please point out where I might be going wrong?</p>
  
  <p>Thanks a lot!</p>