title: c pointers and arrays, copying contents into another array
body: <p>I know this is probably a basic question, but i've never fully grasped the whole pointers concept in C.</p>
  
  <p>My question is, say i have an int array and I pass that into a function like 
  `</p>
  
  <pre><code>int main(){
      int *a = malloc(sizeof(int*)*4);
  
      // add values to a
      p(a);
  }
  
  void p(int *a){
     int *b = malloc(sizeof(int*)*4)
     b = a;
     // change values in b
  
     //print a b
  }`
  </code></pre>
  
  <p>What is the correct way to do this  so that whatever changes I make to b do not affect the values in a?</p>