title: Call of overloaded function is ambiguous
body: <p>What does this error message mean?</p>
  
  <pre><code>error: call of overloaded ‘setval(int)’ is ambiguous
  huge.cpp:18: note: candidates are: void huge::setval(unsigned int)
  huge.cpp:28: note:                 void huge::setval(const char*)
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #define BYTES 8
  using namespace std ;
  
  class huge {
  private:
      unsigned char data[BYTES];
  public:
      void setval(unsigned int);
      void setval(const char *);  
  };
  
  void huge::setval(unsigned int t) {
      for(int i = 0; i&lt; BYTES ; i++) {
          data[i] = t;
          t = t &gt;&gt; 1;
      }
  }
  
  void huge::setval(const char *s) {
      for(int i = 0; i&lt; BYTES ; i++)
          data[i] = s[i];
  }
  
  int main() {
      huge p;
      p.setval(0);
      return 0;
  }
  </code></pre>