title: Read integer after reading a string from a file using fscanf
body: <p>I've made a program which has test.txt file which contains following</p>
  
  <blockquote>
    <p>24 Rohit Soni 1997</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void main()
  {
      FILE *f;
      int no,i;
      char *name;
      f=fopen("test.txt","r");
      fscanf(f,"%d %[^[0-9]]s %d ",&amp;no, name, &amp;i);
      printf("%d %s %d",no, name,i);
      fclose(f);
  }
  </code></pre>
  
  <p>But it is not showing the correct output.
  Output is:</p>
  
  <blockquote>
    <p>24 Rohit Soni 12804</p>
  </blockquote>
  
  <p>Please tell me what to do.  Why is it not accepting an integer after taking string from <code>fscanf</code> using <code>%[</code> format specifier.</p>