title: C - Reading CSV file in char array
body: <p>I have a very little experience in C programming, particularly File Handling. I am developing a project in which I'm supposed to create a Sign Up/Log In system. I have a .csv file in which the data are separated by , 
  What I am trying to do is reading the first and second column into two char arrays respectively.</p>
  
  <pre><code>char userLogin[100]; 
  char userPassword[100];
  FILE *file3 = fopen("C:\\Users\\Kshitiz\\Desktop\\BAAS\\signup_db.csv","r");
  if(file3 != NULL){
          while(!feof(file3)){
          fscanf(file3,"%[^,],%s",userLogin,userPassword);
          puts(userLogin);
          puts(userPassword);
          }
  
      }
  
  
   fclose(file3);
  </code></pre>
  
  <p>Content of signup_db.csv:</p>
  
  <pre><code>Username,Password
  SBI063DDN,Qazwsx1234
  ICICIDDN456,WSXEDC1234r
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>Username
  Password
  
  SBI063DDN
  Qazwsx1234
  
  ICICIDDN456
  WSXEDC1234r
  </code></pre>
  
  <p>Output which I'm getting:</p>
  
  <pre><code>Username
  Password
  
  SBI063DDN
  Qazwsx1234
  
  ICICIDDN456
  WSXEDC1234r
  
  
  WSXEDC1234r
  </code></pre>
  
  <p>Can anyone please help me how can I resolve this issue? Thank you!</p>