title: How to use fscanf() to input different parameters？
body: <p>I try to use fscanf() to input parameters from txt file.
  Here's my code:</p>
  
  <pre><code>fpin = fopen("parameter_file.txt","r");
  fscanf(fpin,"%d\n", &amp;code_value);
  fscanf(fpin,"%d\n", &amp;origin_x);
  fscanf(fpin,"%d\n", &amp;origin_y);
  fscanf(fpin,"%d\n", &amp;dpi);
  fscanf(fpin,"%d\n", &amp;width);
  fscanf(fpin,"%d\n", &amp;height);
  </code></pre>
  
  <p>And the parameter_file.txt is(for exemple):</p>
  
  <pre><code>333 
  123 
  123 
  800
  6
  8
  </code></pre>
  
  <p>I want to add some annotation after each line. For example:
  <code>333 //code_value</code> or <code>123 //origin_x</code> My problem is when I add some characters, fscanf() does not work as I desired to read the continues parameters.</p>
  
  <p>I have tried <code>fscanf(fpin,"%[^a-z]%d\n", &amp;code_value);</code></p>
  
  <p>Another problem is when the input file as follow, how can my code realize?</p>
  
  <pre><code>333 //code_value_1
  123 //origin_x_1
  123 //origin_y_1
  800 //dpi_1
  6 //width_1
  8 //height_1
  12 // code_value_2
  10 //origin_x_2
  20 //origin_y_2
  800 //dpi_2
  10 //width_2
  10 //height_2
  .
  .
  .
  20 // code_value_n
  10 //origin_x_n
  20 //origin_y_n
  800 //dpi_n
  30 //width_n
  30 //height_n
  </code></pre>