title: How to use fscanf to read lines separated by semicolon
body: <p>For example, I am trying to get the total age from a text file separated by semicolons with the format of <code>Name;Age;Favorite Number</code></p>
  
  <pre><code>Jack;12;3
  Red;21;15
  Blue;14;6
  </code></pre>
  
  <p>I have tried doing something like this.</p>
  
  <pre><code>File *fp;
  fp = fopen(in_file,"r");
  int sum = 0, age = 0, fav_number = 0;
  while (fscanf(fp,"%c %f %f", name, age, fav_number) != EOF) {
      fscanf(fp, "%c %f %f", name, age, fav_number);
      sum += age;
  }
  </code></pre>
  
  <p>But since it is not separated with space by with semicolon, it wouldn't work. I am not sure how to change it. Any clue on how to do it?</p>