Why does Passing Pointers as input arguments allow "swapping" and other possibly unintended side effects?
<p>C beginner. Below is a page from the lecture notes at my university (4 hours total to learn structured programming). The procedure manages to change the places that global pointers address, despite not having any output. This is confusing as hell, and seems a dangerous thing to be allowed. Can anyone explain what is happening in the second case, and <strong>how</strong> it happens. Ie: how are the normal rules bypassed?</p>

<blockquote>
  <p><img src="https://i.stack.imgur.com/jeevh.jpg" alt="Pointers as input arguments slide"></p>
</blockquote>

<p>I know <a href="https://stackoverflow.com/questions/26819552/passing-pointers-to-functions">this has been asked from a "I want to use this" background here</a> and less generally in other places. But I am asking why this is allowed, when normally, changing values in a function would produce no effect unless they are returned?</p>