title: Trouble using fscanf() in c
body: <p>I am making a program in C on banking record system. I was trying to read bank info from a file in which every line represents an account and has its info [each field separated by a colon(:)] and storing that info in an array of structs. The file reading part of code is shown below:</p>
  
  <pre><code>while(fscanf(fp,"%s : %s : %s : %d : %s : %ld : %s : %s : %f :\n",
      accounts[j].bank_name, accounts[j].bank_branch, accounts[j].IFSC_code,
      &amp;accounts[j].acc_number, accounts[j].acc_holder_name, &amp;accounts[j].aadhar_no,
      accounts[j].holder_address, accounts[j].address_proof, &amp;accounts[j].balance) != EOF) {
          j++;
      }
  </code></pre>
  
  <p>It works erroneously, some parts being read and some not. Moreover I am not able to capture sentences in char arrays. I am not sure how to use the <code>"%[^\n]%*c"</code> thing we used in scanf() to do so.</p>
  
  <p>Please help me out if you can.</p>