title: return an array from a function for later use
body: <p>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 </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void make_arr(){
      int x =0;
      cin &gt;&gt; x;
      int arr[x] = {};
      for (int i = 0; i &lt; x; i++){
          cin &gt;&gt; arr[i];
          cout &lt;&lt; "-------&gt; " &lt;&lt; arr[i] &lt;&lt; endl;
      }
      for  (int i= 0 ; i &lt; x; i++) { cout &lt;&lt; arr[i] &lt;&lt; endl; } 
  
  }
  int main()
  {
     int n;
     int q; 
     cin &gt;&gt; n &gt;&gt;  q;
  
     for (int i; i &lt; n; i++) { 
     make_arr();
  
     }
     return 0;
  }
  </code></pre>
  
  <p>i am using gcc 7.2 </p>