I want to pass an array to a function, then point that array variable to a new address altogether within said function.

I realize that arrays behave as pointers to the adress of their first element when passed to a function, so why the heck won't the address change for my array variable in main?

```
 #include <iostream>

 using namespace std;

 void passArrayByReference(int * array) { //passing array as.        pointer should let us modify it's address, correct?
     cout << "Address of array in function is: " << array << endl; 
     int * localArray = new int [2];
     //put some dummy values in our localArray
     localArray[0] = 9;
     localArray[1] = 9;
     array = localArray;
     cout << "Address of array in function is now: " << array <<      endl; 
 }

 int main()
 {
    int * array = new int [2];
    int totalElements = 2;
    //put some initial values into our dynamic 1D array
    array[0] = 0;
    array[1] = 1;
    //print our initial values
    for(int i = 0; i < totalElements; i++)
         cout << array[i] << endl;
    cout << "Address of array in main: " << array << endl; 
    passArrayByReference(array);
    cout << "Address of array in main: " << array << endl; 

    return 0;
 }

```