Beginner question about getting reference to cin
<p>I'm having problems wrapping my head around this. I have a function</p>

<pre><code>void foo(istream&amp; input) {
     input = cin;
}
</code></pre>

<p>This fails (I'm assuming because cin isn't supposed to be "copyable".</p>

<p>however, this works</p>

<pre><code>void foo(istream&amp; input) {
    istream&amp; baz = cin;
}
</code></pre>

<p>Is there a reason that I can get a reference to cin in baz but I cannot assign it to input?</p>

<p>Thanks</p>
