I can not figure out how to pass a vector back to main after it has been through the loop
<pre><code>#include &lt;vector&gt;

#include &lt;iostream&gt;

using namespace std;

vector&lt;int&gt; fibonacci(int x, int y,vector&lt;int&gt; vi,int n){

    vi[0]=x;
    vi[1]=y;

   for(int i=2;i&lt;n;i++){

       x=vi[i-2];
       y=vi[i-1];
       vi[i]=x+y;

       cout&lt;&lt;vi[i]&lt;&lt;" "&lt;&lt;endl;

   }
return vi;

}

void printv(string label, vector&lt;int&gt; vi, int n){

   cout&lt;&lt;label&lt;&lt;" "&lt;&lt;endl;
   for (int j=0; j&lt;n; j++)
       cout&lt;&lt;vi[j]&lt;&lt;" "&lt;&lt;endl;

}
/*void reverseV(vector&lt;int&gt; vi,int n)
{
    vector&lt;int&gt; rv= vi;
    for (int i=rv.size()-1; i&gt;=0; i--) {
            cout &lt;&lt; rv[i] &lt;&lt; endl;
        }*/
//}

int main()
{
    int x;
    int y;
    vector&lt;int&gt; vi;
    vector&lt;int&gt; rv;
   int n=100;
string label;
   cout&lt;&lt;"enter the max number of times you want it to add"&lt;&lt;endl;

   cin&gt;&gt;n;
cout&lt;&lt;"enter the first two fibonacci numbers"&lt;&lt;endl;
cin&gt;&gt;x&gt;&gt;y;
   fibonacci(x,y,vi,n);
 printv("vector: ",vi,n);
 printv("vector: ",rv,n);
 //vi.swap(rv);
}
</code></pre>
