title: How can you double space a file in C? Then print to STDOUT.
body: <p>I need to read in a file, then print it out to STDOUT but double spaced. What I have so far is:</p>
  
  <pre><code>#include &lt;fcntl.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define BUFSZ 1024
  
  int main(int argc, char* argv[]){
  
  int n, fdin;
  char buf[BUFSZ];
  
  if ((fdin=open(argv[1],O_RDONLY))&lt;0){
    perror(argv[1]);
    exit(-1);
  }
  while(( n = read(fdin, buf, BUFSZ))&gt;0){
   if(write(STDOUT_FILENO,buf,n) != n){
    fprintf(stderr, "Write Error\n");
    exit(-1);
   }
   printf("\n");
  }
  close(fdin);
  return(0);
  }
  </code></pre>
  
  <p>I'm new to C and don't know how I could implement the \n into the code, my printf("\n") is useless in trying to double space the entire file's contents. I think I have to add the \n into the read? But I'm not entirely sure if that's correct or how to do it.  </p>