title: "ptr = ptr - > next" What does this "->" mean? (C++)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/221346/what-can-i-use-instead-of-the-arrow-operator">What can I use instead of the arrow operator, <code>-&amp;gt;</code>?</a><br>
    <a href="https://stackoverflow.com/questions/4113365/what-does-mean-in-c">What does -&gt; mean in C++?</a>  </p>
  </blockquote>
  
  
  
  <p>So I'm currently studying for a C++ exam about Data Structure and Algorithm Development. While looking though my teacher powerpoints, I've noticed that he's used this "->" a lot. And I'm not sure what it means? Is it really a command you can do in c++? </p>
  
  <p>Example 1</p>
  
  <pre><code>addrInfo *ptr = head;
  while (ptr-&gt;next != NULL) 
  {
          ptr = ptr-&gt;next;
  }   
  // at this point, ptr points to the last item
  </code></pre>
  
  <p>Example 2</p>
  
  <pre><code>if( head == NULL )
  {
  head = block;
  block-&gt;next = NULL;
  }
  </code></pre>