title: Does *ptr++ has a side effect on the next memory location?
body: <p>As far as I know, <code>*ptr++</code> should be evaluated to get the value in the original <code>ptr</code> address, and <code>ptr</code> gets updated to point to the next memory location. So the only thing that should be changing here is the address held by <code>ptr</code>.
  However when I ran this program</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
      int main()
      {
          int x=5;
          int *ptr= &amp;x;
          int val= *ptr++;
          printf("%i\n", val); 
          printf("%i", *ptr);
          return 0;
      }
  </code></pre>
  
  <p>I expected to get </p>
  
  <pre><code>5
  //Some random value
  </code></pre>
  
  <p>But the output shows always</p>
  
  <pre><code>5
  5
  </code></pre>
  
  <p>So what am I missing here?</p>