Question: 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:

```
int main()
{
  myarray[3] = {4, 5, 6};

  myfunc(myarray);

 return 0;
}

int myfunc(int myarray[])
{
  int x
  cout << "Choose a number";
  cin >> x

  if (x == 1)
   {
     myarray[] = {0, 1, 3}
   } 
  else
   {
     some code
   }

return 6;
}

```

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.

Answer: 
You can modify elements in the array however initializer lists like this:

```
myarray[] = {0, 1, 3}

```

can only be used when you declare the array. To assign to the array you will have to assign each element individually:

```
myarray[0] = 0;
myarray[1] = 1;
myarray[2] = 3;

```
This: `myarray[] = {0, 1, 3}` - is wrong.

You should pass the length of the array, and run a loop that would change its values, instead.

You should never assume a size of the array you get in a function. If the size is constant - make it `myfunc(int myarray[THE_SIZE])`, otherwise it has to be `myfunc(int myarray[], int size)`, where `size` is the size of the array passed.