Assigning one type of object to other type of reference variable not working
<p>Consider the following code:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
class B{
public:
  B(){}
};
class A
{
public:
A(){}
A(B &amp;b){

}
A(const B &amp;b){
       cout&lt;&lt;"cccddd"&lt;&lt;endl;
}
};
int main()
{
   B b;
   A c(b);
   A a;
   a=b; //ok
   A &amp;ref = b; //error and why???
}
</code></pre>

<p>why b assigned to a is ok,but b assigned to ref is illegal???</p>
