title: Difference between specifications of fread and fgets?
body: <p>What is the difference between fread and fgets when reading in from a file?
  I use the same fwrite statement, however when I use fgets to read in a .txt file it works as intended, but when I use fread() it does not. </p>
  
  <p>I've switched from fgets/fputs to fread/fwrite when reading from and to a file. I've used fopen(rb/wb) to read in binary rather than standard characters. I understand that fread will get /0 Null bytes as well rather than just single lines.</p>
  
  <pre><code>  //while (fgets(buff,1023,fpinput) != NULL) //read in from file
    while (fread(buff, 1, 1023, fpinput) != 0) // read from file
  </code></pre>
  
  <p>I expect to read in from a file to a buffer, put the buffer in shared memory, and then have another process read from shared memory and write to a new file. </p>
  
  <p>When I use fgets() it works as intended with .txt files, but when using fread it adds a single line from 300~ characters into the buffer with a new line. Can't for the life of me figure out why.</p>