How to handle the ambiguity between default constructor and overloaded constructor?
<p>The line A b(3) produces ambiguity as it could invoke any of the two possible constructors. Either the single argument parametrized constructor or the two-argument parametrized constructor with default argument. How do i solve this?</p>

<pre><code>#include&lt;iostream&gt;
using namespace std;
class A
{
    public:
    int a,b;
    A()
    {
        a=5;
        b=6;
    }
    A(int a1)
    {
        a=a1;
        b=54;
    }
    A(int a1,int b2=8)
    {
        a=a1;
        b=b2;
    }
    void show()
    {
        cout&lt;&lt;"a="&lt;&lt;a&lt;&lt;" b="&lt;&lt;b&lt;&lt;endl;
    }
};    
int main()
{
    A a(3); // I want A(int a1,int b2=8) to get executed
    A b(3); // I want A(int a1) to get executed
    a.show();
    b.show();
    return 0;
} 
</code></pre>
