title: error C2059: syntax error : 'type'
body: <p>I've got error: </p>
  
  <pre><code>main.c(10) : error C2059: syntax error : 'type'. 
  </code></pre>
  
  <p>What's wrong with this code?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void getline(FILE* file, char* line)
  {
      int c;
      size_t n = 0;
      while(c=fgetc(file)!='\n')
      {
        line[n++] = char(c);
      }
      line[n] = '\0';
  }
  
  int main(int argc, char* argv[])
  {
      FILE* f;
      char* line = (char*)malloc(100);
      f = fopen("Saxo","r");
      if(f==NULL)
        return -1;
      getline(f,line);
      free(line);
      fclose(f);
      return 0;
  }
  </code></pre>