title: how to use EOF with fgets() in C
body: <p>I'm trying to read in inputs from the terminal, I want to stop reading inputs if there is a blank line and enter is pressed. Here is what I have at the moment.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
     int main(int argc,char const *argv[]){
         char input[1024];
  
         while(fgets(input,1024,stdin)!=NULL){
            printf("%s", input);
         }
         if(EOF){
            printf("EOF");
         }
  
          return 0;
  }
  </code></pre>