title: error: undeclared here (not in a function)
body: <p>I am getting this error on the last line of the code, as I am trying to read data from an extra.txt file. Records are read properly from an input.txt but not sure why it is throwing error for extra file. Thanks!</p>
  
  <pre><code>typedef struct {
      char* fname;
      char* lname;
      int id;
      int age;
  } data;
  
  typedef struct {
      data** array;
      int len;
      int cap;
  }vector;
  
  vector* vector_read(FILE* in_file)
  {
      int i;
      vector *v = (vector*)malloc(sizeof(vector));
      fscanf(in_file,"%d",&amp;v-&gt;len);
      if(in_file=NULL)
       {
         return NULL;
       }
      printf("%d",v-&gt;len);
      data** array = (data**)malloc(sizeof(data*)*(v-&gt;len));
      v-&gt;array = array;
      data *temp;
  
     for(i=0;i&lt;(v-&gt;len);i++)
     {    
       temp = data_read(in_file);        
       v-&gt;array[i] = temp;
     }
  
  return v;
  }
  
      vector *v = vector_read(input);
      printf( "initial state of vector v\n");
      vector_print(v);
      vector *v_add = vector_read(extra); 
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>extra.txt has records in this fashion: </p>
  
  <pre><code>4
  
  Barak Obama 101 50  
  Joe Biden 102 55  
  Joe Plumber 10293 45  
  Wayne Gretzky 99 56
  </code></pre>
  
  <p>and input.txt</p>
  
  <pre><code>1
  
  Aaaa
  Aooo
  1
  20
  </code></pre>