title: How to pass struct array into a function and correctly store value in it?
body: <p>I would like to read a file that has the sample number, values and status(1.1, 23,0). I used a Struct to hold that information. I will pass the function struct array and the file location.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  struct Data_point
  {
      long sampleNumber;
      double value;
      int status;
  };
  
  
  int filldata(struct Data_point *a, const char *filelocation)
  {
      FILE *f;
      if((f=fopen(filelocation,"r"))==NULL)
      {
          printf("You cannot open");
      }
      fscanf(f, "%ld%lf%d", a.sampleNumber, a.value, a.status);
  }
  
  
  
  int main(void)
  {
      struct Data_point data[10];
      filldata(data, "/home/alexchan/IntrotoC/rec11/dataPoints.txt");
      return 0;
  }
  </code></pre>
  
  <p>But, I got an error saying, "request for member not a structure"...</p>