title: Unexpected results while passing arrays as parameters in C?
body: <p>I am trying to get used to using pointers but i am struggling a bit whilde passing them into functions as parameters. I read that arrays are passed by reference to functions therefore a code like this can change the array elements(Assuming a valid array is given):</p>
  
  <pre><code>void f(int *b)
  {
    b[2]=1;
  }
  
  in main:
  f(validArray);
  </code></pre>
  
  <p>However even though we pass the pointer  this doesn't seem to work;</p>
  
  <pre><code>void foo(int *b)
  {
    b=b+2;
  }
  
  in main:
  f(validArray);
  </code></pre>
  
  <p>doesn't move the pointer a step further.
  Why is that?</p>