title: C++ Radix sort algorithm
body: <p>Trying to understand radix sort for my data structures class. My teacher showed us a sample of radix sort in C++. I don't understand what the for loop for the digits does, she said something about maximum digits. Also when I try this in VS it says log10 is an ambiguous call to an overloaded function.</p>
  
  <pre><code>void RadixSort(int A[], int size)
  {
      int d = 1;
          for(int i = 0; i &lt; size; ++i) 
          {
              int digits_temp;
              digits_temp=(int)log10(abs(A[i]!=0 ? abs(A[i]) : 1)) +1;
              if(digits_temp &gt; d)
                  d = digits_temp;
          }
          d += 1;
  
  *rest of the implementation*
  }
  </code></pre>
  
  <p>Can anyone explain what this for loop does and why i get that ambiguous call error? Thanks</p>