title: trouble with fscanf when using structs
body: <pre><code>typedef struct computer
  {
  char serialNumber[8];
  int price;
  int GBofRAM;
  int GBofHardDrive;
  }Computer;
  
  Computer* readComputers(char* filename);
  
  
  int main(int argc, char** argv) {
  
  if(argc!=2){
      printf("Invalid number of arguments");
      return 1;
  }
  Computer* x=readComputers(argv[1]);
  printComputers(x);
  
  free(x);
  return (EXIT_SUCCESS);
  }
  Computer* readComputers(char* filename)
  {
  
  Computer* cptr=malloc(sizeof(Computer)*6);
  FILE* fp=fopen(filename, "r");
  if(fp==NULL){
      printf("Failed to open file %s", filename);
      return;
  }
  //fread(cptr, sizeof(Computer), 6, fp);
  
  fscanf(fp,"%s, %d, %d, %d", Computer-&gt;serialNumber, &amp;Computer-&gt;price, &amp;Computer-&gt;GBofRAM, &amp;Computer-&gt;GBofHardDrive);
  
  fclose(fp);  
  return cptr;
  </code></pre>
  
  <p>I'm having issues getting this <code>fscanf()</code> to work correctly. it's saying it's missing an expression before <code>Computer-&gt;serialNumber</code> but I'm not sure why that's the case? I've tried looking on Tutorialspoint but that wasn't of too much help.</p>