title: Ambiguous call to overloaded function 'pow'
body: <p>I'm having some problems runnning the following code. I got this: error C2668: 'pow' : ambiguous call to overloaded function. I've tried to manually cast the arguments to the appropiate type using static_cast, however I think I get some pointer errors?!</p>
  
  <p>The program should convert a number from base 16 to base 10.</p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;conio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  
  //base 16 to base 10
  
  int convert(char *n){
      int result = 0;
      for (int i = strlen(n) - 1; i &gt;= 0; i--){
          if (n[i] &gt;= 'a')
              result += (n[i] - 'a' + 10)* pow(16, strlen(n) - i - 1);
          else
          if (n[i] &gt;= 'A')
              result += (n[i] - 'A' + 10)* pow(16, strlen(n) - i - 1);
          else
          if (n[i] &gt;= '0')
              result += (n[i] - '0')* pow(16, strlen(n) - i - 1);
      }
      return result;
  }
  
  void main(void){
      char n[10];
      printf("Introduceti numarul: "); scanf("%s", n);
      printf("Numarul in baza 10 este: %d", convert(n));
      _getch();
  }
  </code></pre>
  
  <p>Those are all the errors.</p>
  
  <pre><code>1&gt;------ Build started: Project: pr8, Configuration: Debug Win32 ------
  1&gt;  pr8.cpp
  1&gt; error C2668: 'pow' : ambiguous call to overloaded function
  1&gt; could be 'long double pow(long double,int) throw()'
  1&gt; or       'long double pow(long double,long double) throw()'
  1&gt; or       'float pow(float,int) throw()'
  1&gt; or       'float pow(float,float) throw()'
  1&gt; or       'double pow(double,int) throw()'
  1&gt; or       'double pow(double,double)'
  1&gt;          while trying to match the argument list '(int, size_t)'
  1&gt;'-' : pointer can only be subtracted from another pointer
  1&gt; error C2668: 'pow' : ambiguous call to overloaded function
  1&gt; could be 'long double pow(long double,int) throw()'
  1&gt; or       'long double pow(long double,long double) throw()'
  1&gt; or       'float pow(float,int) throw()'
  1&gt; or       'float pow(float,float) throw()'
  1&gt; or       'double pow(double,int) throw()'
  1&gt; or       'double pow(double,double)'
  1&gt;          while trying to match the argument list '(int, size_t)'
  1&gt; error C2668: 'pow' : ambiguous call to overloaded function
  1&gt; could be 'long double pow(long double,int) throw()'
  1&gt; or       'long double pow(long double,long double) throw()'
  1&gt; or       'float pow(float,int) throw()'
  1&gt; or       'float pow(float,float) throw()'
  1&gt; or       'double pow(double,int) throw()'
  1&gt; or       'double pow(double,double)'
  1&gt;          while trying to match the argument list '(int, size_t)'
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>How can I fix this? Thank you.</p>