is there any way to save the arrays that are generated bt the make_arr() function so that i can access or modify that array contents outside the void function or is there any way that i can return the array
#include <iostream>
using namespace std;
void make_arr(){
int x =0;
cin >> x;
int arr[x] = {};
for (int i = 0; i < x; i++){
cin >> arr[i];
cout << "-------> " << arr[i] << endl;
}
for (int i= 0 ; i < x; i++) { cout << arr[i] << endl; }
}
int main()
{
int n;
int q;
cin >> n >> q;
for (int i; i < n; i++) {
make_arr();
}
return 0;
}
i am using gcc 7.2