title: error using fgets()
body: <p>Hi can someone help me with this error?
  The errors I'm getting are:</p>
  
  <pre><code>Building target: Programming Cpt220
  /bin/sh: -c: line 0: syntax error near unexpected token `('
  Invoking: MacOS X C++ Linker
  /bin/sh: -c: line 0: `g++  -o "Programming Cpt220"  ./fgets()exampleFromTheNet.o   '
  make: *** [Programming Cpt220] Error 2
  g++  -o "Programming Cpt220"  ./fgets()exampleFromTheNet.o 
  </code></pre>
  
  <p>I'm not sure why ist is asking for g++ -o
  I'm using eclipse on Mac.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define  MAX_LEN  100
  
  int main(void)
  {
     FILE *stream;
     char line[MAX_LEN], *result;
  
     stream = fopen("myfile.dat","r");
  
     if ((result = fgets(line,MAX_LEN,stream)) != NULL)
         printf("The string is %s\n", result);
  
     if (fclose(stream))
         printf("fclose error\n");
  
  
  }
  </code></pre>