What's the best way to get the length of the decimal representation of an int in C++?
<p>What's the best way to write</p>

<pre><code>int NumDigits(int n);
</code></pre>

<p>in C++ which would return the number of digits in the decimal representation of the input.  For example 11->2, 999->3, -1->2 etc etc.</p>
