title: How to get characters separated by space using scanf
body: <p>Here is <code>input.txt</code></p>
  
  <pre><code>5
  A B C D E
  </code></pre>
  
  <p>I want to get these characters so I used this code:</p>
  
  <pre><code>//...
  int n;
  fscanf(fp_i, "%d", &amp;n);
  //...
  char data;
  for (int i = 0; i &lt; n; i++) {
      fscanf(fp_i, "%c", &amp;data);
      array_c[i] = data;
  }
  //...
  </code></pre>
  
  <p>There were still spaces in <code>array_c</code>, so I tried <code>" %c "</code>, and it worked! </p>
  
  <p>I want to learn of another way to get characters with spaces. Is there a more sophisticated way?</p>