title: C++,function overloading problem
body: <p>I am having a trouble in this example.Whenever I send any arguments,it gives compiler error:</p>
  
  <pre><code>prog.cpp: In function ‘int main()’:
  prog.cpp:11: error: call of overloaded ‘add(std::basic_istream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, std::basic_istream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;)’ is ambiguous
  prog.cpp:4: note: candidates are: int add(int, int) &lt;near match&gt;
  prog.cpp:6: note:                 char add(char, char) &lt;near match&gt;
  </code></pre>
  
  <p>I personally think that this error should occur when I am sending the arguments as int's or char's but when I send float arguments,the error still remains.Please help.Thanks</p>
  
  <pre><code>/*Function Overloading*/
  #include&lt;iostream&gt;
  using namespace std;
  int add(int a,int b);
  float add(float a,float b);
  char add(char a,char b);
  int main()
  {
  float a,b;
    cout&lt;&lt;"Enter Two numbers to add them"&lt;&lt;'\n';
    add(cin&gt;&gt;a,cin&gt;&gt;b);
    return 0;
  }
  int add(int a,int b)
  {
  //cin&gt;&gt;a,b;
  return a+b;
  }
  float add(float a,float b)
  {
  //cin&gt;&gt;a,b;
  return a+b;
  }
  char add(char a,char b)
  {
  //cin&gt;&gt;a,b;
  return a+b;
  }
  </code></pre>