call of overloaded function is ambiguous, double vs float
<p>Whenever I run this code...</p>

<pre><code>#include &lt;iostream&gt;

int add(int x, int y){
    return x+y;
} 

float add(float x, float y){
    return x+y;
}

int main(){
    using namespace std;
    add(1.11, 1.11);
    return 0;
}
</code></pre>

<p>... I get this error:</p>

<pre><code>18.cpp: In function ‘int main()’:
18.cpp:24:16: error: call of overloaded ‘add(double, double)’ is ambiguous
  add(1.11, 1.11);
                ^
18.cpp:24:16: note: candidates are:
18.cpp:7:5: note: int add(int, int)
 int add(int x, int y){
     ^
18.cpp:11:7: note: float add(float, float)
 float add(float x, float y){
</code></pre>

<p>I thought 1.11 would be clearly a float, not an integer. When I change <code>float</code> to <code>double</code>, the program works.</p>

<p>Why does C++ say the call is ambiguous? </p>