title: Interpreting data from fread()
body: <p>So I am attempting to pass a <code>.txt</code> file through my code to have it echo the characters individually into the output. I am running the script like</p>
  
  <pre><code>./a.out &lt; testWords.in &gt; myOut.out
  </code></pre>
  
  <p>The crux is this bit here:</p>
  
  <pre><code>size_t bytes = fread(buffer. sizeof(char),sizeof(char),stdin);
  fwrite(buffer,sizeof(char),bytes,stdout);
  fflush(stdout);
  </code></pre>
  
  <p>which works fine.</p>
  
  <p>But how can I interpret characters 1 by 1 in an if statement? For example</p>
  
  <pre><code>if (bytes == '\n')
  </code></pre>
  
  <p>doesn't trigger on new lines.</p>
  
  <p>EDIT:</p>
  
  <p>getc(stdin) is a much more efficient way to accomplish my task.</p>