title: read a file for a particular input format
body: <p>How to read a file in c when the given input format is </p>
  
  <pre><code>4
  5
  3
  a,b
  b,c
  c,a
  </code></pre>
  
  <p>Please help...this my file scanning function. here m should store 4 ,n should store 5 and l should store 3. then col1 will store{abc} and col2will store{bca}
  m n , l are int.
  col1 and col2 are char arrays
  The third line of the file indicates a value 3 , which refers that there are three line below it and it contain 3 pairs of characters.</p>
  
  <pre><code>i = 0, j = 0;
  while (!feof(file))
  {
    if(j==0)
    {
      fscanf(file,"%s\t",&amp;m);
      j++;
    }
    else if(j==1)
    {
      fscanf(file,"%s\t",&amp;n);
      j++;
    }
    else if(j==2)
    {
      fscanf(file,"%s\t",&amp;l);
      j++;
    }
    else
    {
      /* loop through and store the numbers into the array */
      fscanf(file, "%s%s", &amp;col1[i],&amp;col2[i]);
      i++;
    }
  }
  </code></pre>
  
  <p>but my result is not coming please tell how to proceed ....</p>