title: I'm having trouble figuring out the difference between these two blocks of code
body: <p>Alright, this is a really quick question: why does this first block of code compile, but the second one doesn't? They seem like they should be equivalent, since all that I change is the variable declaration/references.</p>
  
  <p>First:</p>
  
  <pre><code>int memberStudents(struct studentType x, Snodeptr students, Snodeptr *s) {
      Snodeptr p = *s;
  
      while (p-&gt;next != NULL) {
          if (strcmp(x.sid, p-&gt;student.sid) == 0)
              return 1;
  
          p = p-&gt;next;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Second:</p>
  
  <pre><code>int memberStudents(struct studentType x, Snodeptr students, Snodeptr *s) {
      while (s-&gt;next != NULL) {
          if (strcmp(x.sid, s-&gt;student.sid) == 0)
              return 1;
  
              s = s-&gt;next;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I want to change the Snodeptr s so that it points to the proper place, but when I try the second block of code I get an error saying there is a request for member 'next' in something not a struct or union.</p>