title: Edit where a pointer points within a function
body: <p>I have a pointer to a struct object in C++.</p>
  
  <pre><code> node *d=head;
  </code></pre>
  
  <p>I want to pass that pointer into a function by reference and edit where it points. I can pass it but it doesn't change where the initial pointer points but only the local pointer in the function. The arguments of the function must be a pointer right? And after how do I change it to show to a different object of the same struct?</p>