title: Passing an array to a function and then changing the values?
body: <p>Basically, let's say I declare an array in int main() and then pass it to another function, can i then change what values the array holds? Something like:</p>
  
  <pre><code>int main()
  {
    myarray[3] = {4, 5, 6};
  
    myfunc(myarray);
  
   return 0;
  }
  
  int myfunc(int myarray[])
  {
    int x
    cout &lt;&lt; "Choose a number";
    cin &gt;&gt; x
  
    if (x == 1)
     {
       myarray[] = {0, 1, 3}
     } 
    else
     {
       some code
     }
  
  return 6;
  }
  </code></pre>
  
  <p>This code obviously does not compile, but I can't really think of any other ways to change the values in the array within the function. </p>