How to inverse an array without forming a new one in C/C++ : I wanted to write a function that would inverse an array and would print the inverted array without forming a new one.

I wrote a code that can inverse an array, but I have to form a new array in order to do that.

```c++
#include<iostream>
using namespace std;

void inverse(int arr[], int size) {
  int arr2[size];
  for (int i = 0; i < size; i++)
    arr2[arr[i] - 1] = i + 1;
  for (int i = 0; i < size; i++)
    cout << arr2[i] << " ";
}

int main() {
  int arr[] = {2, 3, 4, 5, 1};
  int size = sizeof(arr) / sizeof(arr[0]);
  inverse(arr, size);
  return 0;
}
```