title: checking my memory for a specific character - can't do it
body: <p>I have have memory allocated for a file to be able to read from a input file. </p>
  
  <pre><code>((mem = (unsigned char *) malloc (filesize)) == NULL)
  </code></pre>
  
  <p>I have it reading from the memory (file technically). This loop will read the contents of memory and write each character into another output file only until a preset limit then it will continue to write to the next line (default 40 for each line). I have it correctly reading and writing, as well as wraping at 40 for each line BUT, the input file has multiple lines of different lengths, and the writing to the new file is including the "\n" (new lines) thus making multiple lines lengths but no greater than 40. I need to check when there is a "\n" and skip over it.</p>
  
  <p>This is my problem, I'm not sure how to check if I've hit a "\n". </p>
  
  <p>Here is my sad attempt (a part of the loop):</p>
  
  <pre><code>fread(mem, 1,filesize, inf);
  for(i=0; i &lt; filesize; i++)
  {
  *temp = mem[i];
      if (!strcmp(temp,"\n"));
          {
              i++;
          }
  </code></pre>