I am allocating memory as follows. Also trying to update it in another function.

```
int main() {
  int* ptr = (int*)malloc(sizeof(int)*3);
  ptr[0] = 0;
  ptr[1] = 1;
  ptr[2] = 2;
  modifyArr(&ptr, 2);
}

void modifyArr(int** arr, int arrLen)
{
    printf("Before modified\n");
    printArray(*arr, arrLen);
    for (int i = arrLen;  i >= 0; i--)
    {
        *arr[i] = i; // here is error
    }
    printf("After modified\n");
    printArray(*arr, arrLen);
}

```

So how can I modify this array inside another function? 

In case my array would be fixed array as:

```
int arr[] = { 0,1,2 };

```

How can I update it in another function?