title: How to access a local variable from a different function using pointers?
body: <p>May I have any access to a local variable in a different function? If so, how?</p>
  
  <pre><code>void replaceNumberAndPrint(int array[3]) {
      printf("%i\n", array[1]);
      printf("%i\n", array[1]);
  }
  
  int * getArray() {
      int myArray[3] = {4, 65, 23};
      return myArray;
  }
  
  int main() {
      replaceNumberAndPrint(getArray());
  }
  </code></pre>
  
  <p>The output of the piece of code above:</p>
  
  <pre><code>65
  4202656
  </code></pre>
  
  <p>What am I doing wrong? What does the "4202656" mean?</p>
  
  <p>Do I have to copy the whole array in the <code>replaceNumberAndPrint()</code> function to be able to access it more than the first time?</p>