title: compilation error: request for member in something not a structure or union
body: <p><strong>Edit:</strong> <em>The code below has been modified to work as the problem has been solved.</em></p>
  
  <p><em>Specifically, <code>(*hardwareList.next_item)-&gt;next</code> was originally written without brackets (e.g. as <code>*hardwareList.next_item-&gt;next</code>) and the compiler didn't understand it.</em> </p>
  
  <p>I'm trying to workout why the compiler is getting confused with my C code. I'm trying to create a linked list that stores all the items and also a pointer to the address-of the last "next" variable, for easy appending. </p>
  
  <pre><code>typedef struct {
    int recordNum;
    char toolName[25];
    int quantity;
    float cost;
  } HardwareData;
  
  typedef struct _HardwareListItem{
    HardwareData data;
    struct _HardwareListItem* next;
  } HardwareListItem;
  
  typedef struct _HardwareList {
    HardwareListItem* items;
    HardwareListItem** next_item;
  } HardwareList;
  
  HardwareList readFromFile(FILE* fp)
  {
    char stopReading = 0;
    HardwareList hardwareList = {0};
    hardwareList.next_item = &amp;hardwareList.items;
    do {
      *hardwareList.next_item = (HardwareListItem*)calloc(1, sizeof(HardwareData));
      if (*hardwareList.next_item == NULL)
      {
        fprintf(stderr, "OOM Reading File\n");
        fflush(stderr);
        exit(EXIT_FAILURE);
      }
      if (fread(&amp;((*hardwareList.next_item)-&gt;data), sizeof(HardwareData), 1, fp) != 1) {
        free(*hardwareList.next_item);
        *hardwareList.next_item = NULL;
        stopReading = 1;
      } else {
        hardwareList.next_item = &amp;((*hardwareList.next_item)-&gt;next);
      }
    } while(!stopReading);
  
    return hardwareList;
  }
  </code></pre>
  
  <p>Compiler says:</p>
  
  <pre><code>line 31: error: request for member 'data' in something not a structure or union
  line 36: error: request for member 'next' in something not a structure or union
  </code></pre>