title: Traversing through a linked list: while(ptr!=NULL) vs while(ptr->next!=NULL)?
body: <p>Defining a memory cell by</p>
  
  <pre><code>struct node {
      int item;
      node *next;
  };
  </code></pre>
  
  <p>and assuming <code>ptr</code> is pointing to a linked list, is there a difference between putting <code>while(ptr!=NULL)</code> <em>vs</em> <code>while(ptr-&gt;next!=NULL)</code> to loop through the list until reaching the null pointer?</p>