title: Scanf ignoring new line character when scanning from input file
body: <p>I'm working on a program that intends to read multiple lines of strings and sort them into arrays of strings.</p>
  
  <p>I'm trying to read the first line manually and the loop is supposed to exit once it reads the new line character '\n'. This works when I manually enter the strings in terminal, but reading from in input file (through terminal), it does not read the newline character and the loop continues.</p>
  
  <pre><code>char array[20][20];
  char letter = 'a';
  for (int i = 0; letter != '\n'; i++) {
      scanf("%s",array[i]);    //store the word into an array of words
      printf("Scanned %s\n",array[i]);
      scanf("%c",&amp;letter);     //look for space or new line character
  }
  </code></pre>
  
  <p>It works when I manually enter this text, but not when reading it from a file:</p>
  
  <pre><code>word word1 word2
  word3 word4 word5
  </code></pre>
  
  <p>When inputting manually, I would enter the first line, "word word1 word2", hit enter, and it would scan that line and end the program. </p>
  
  <p>When using the file, it returns:</p>
  
  <pre><code>$ ./potw18 &lt; input.txt
  Scanned word
  Scanned word1
  Scanned word2
  Scanned word3
  Scanned word4
  Scanned word5
  Scanned
  Scanned ▒
  Scanned
  Scanned ▒
  Scanned
  Scanned ▒8.▒
  Scanned
  Scanned ▒8.▒
  Scanned
  </code></pre>
  
  <p>And continues on.</p>