title: error:’ undeclared (first use in this function)
body: <p>I have a header file named store.h which contains a struct and my main is located in E.c,i am currently experiencing an error which i can not comprehend why it is happening. Any help is much appreciated</p>
  <p>store.h:</p>
  <pre><code>struct st{
      char *buf,*var;
      int line_number;
      char *keywords;
      char *operators;
  };
  </code></pre>
  <p>E.C</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &quot;store.h&quot;
  #define max 1000000
  int main(int argc,char *argv[]){
  
      FILE *fp;
      int ag=0;
      
      fp=fopen( argv[1],&quot;r&quot;);
      if(fp==NULL){
          printf(&quot;error cannot open file\n&quot;);
          exit(1);
      }                                  
  
      while(feof(fp)==0){  
          *buf=fgets(*buf,max,fp);
      
      // irrelevant commands follow
      
      }
  
      fclose(fp);
  }
  </code></pre>
  <p>On the line <code>*buf=fgets(*buf,max,fp);</code> I get the <code>error:‘buf’ undeclared (first use in this function)</code>, however I have declared it in my struct and I have included the file that contains the struct, where am I wrong?</p>