title: Read from a file using getc and print using putc
body: <p>I'm trying to read each character from a file and print it to the screen using getc and putc alone. Here's my code,</p>
  
  <pre><code>FILE *fp = fopen("new.txt","r+");
  rewind(fp);
  while( feof(fp) == 0 )
  {
        putc( getc(fp) , stdout);
  }
  </code></pre>
  
  <p>When ever I execute this, it runs into an infinite loop. I can't understand how this happens when the file is only a few lines long.</p>
  
  <p>Newbie.</p>