title: invalid application of 'sizeof' to incomplete type list struct C
body: <p>I'm trying to implement an replacement algorithm that deals with page faults. So i'm trying to creat a circular linked list using malloc and im getting the following error: "invalid application of <code>sizeof' to incomplete type</code>pageInMemory'.following is the code:</p>
  
  <pre><code> typedef  struct {
  
              int use; 
              int reference;
              int free;
              struct pageInMemory* next;
              } pageInMemory;
  
  
              int main()
              {
  
                  int i;
                  struct pageInMemory* start, *nn, *temp, *hand;
                  start = NULL;
  
                      for(i=0; i&lt; pNum; i++) 
                      {
                  nn = (struct pageInMemory *)malloc(sizeof(struct pageInMemory));
                          nn-&gt;use = 0;
                          nn-&gt;free = 1;
  
                          if(start==NULL)
                          {
                              nn-&gt;next = nn;
                              start =nn;
                          }
  
                          else
                          {     // sfhsdifhsdifj sdijfjsd 
                              temp = start;
                              while(temp-&gt;next != start)
                              {
                                  temp = temp-&gt;next; 
                              }
  
                              temp-&gt;next = nn;
                              nn-&gt;next = start;
                              start = nn;
  
                          }   
  
                      }
  
  
  
                  hand = start;
                  temp = start;
  
               while(temp-&gt;next != start-&gt;next)
               {
                  printf("%d\n", temp-&gt;use); //hi
               } 
  
  
                  return 0;// bye
               }  
  </code></pre>
  
  <p>so am i not supposed to use malloc this way ?</p>