Unable to change values in a function
<p>I'm starting with developing, sorry about this newbie question.</p>

<p>I need to create a function that swap values between 2 vars.</p>

<p>I have wrote this code, but no changes are made in vars, What should I change? What is my mistake?</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

void swap_values( int x, int y);
int main(void) {
   int a,b;    
   a = 2;   
   b = 5;  
   cout &lt;&lt; "Before: " &lt;&lt; a &lt;&lt; " " &lt;&lt; b &lt;&lt; endl; 
   swap_values( a,b );   
   cout &lt;&lt; "After: " &lt;&lt; a &lt;&lt; " " &lt;&lt; b  &lt;&lt; endl;   
}  
void swap_values( int x, int y ){
   int z;
   z = y;
   y = x;
   x = z;
}
</code></pre>
