c++ beginner errors, homework
<p>I keep getting these 2 errors in my code</p>

<blockquote><pre>In function 'int main()':
error: invalid initialization of non-const reference of type 'int&' from a temporary of type 'int'
error: in passing argument 1 of 'void swapInt(int&, int&)'
</pre></blockquote>

<p>but the real problem I'm having is with swapInt. I need to take in 2 ints
and then switch their values with their parameters so what was once a is now b
and what was once b is now a. please help!</p>

<pre><code>void swapInt (int &amp;a, int &amp;b);

int main() {
    int a = 1;
    int b = 2;

    swapInt(1, 2);
    cout &lt;&lt; a &lt;&lt; " " &lt;&lt; b;

    return 0;
}

void swapInt (int &amp;a, int &amp;b) {
    int c = a;
    a = b;
    b = c;
    //cout &lt;&lt; a &lt;&lt; " " &lt;&lt; b;
}
</code></pre>
