title: Get the number of digits in an int
body: <p>How do I detect the length of an integer? In case I had le: int test(234567545);</p>
  
  <p>How do I know how long the int is? Like telling me there is 9 numbers inside it??? </p>
  
  <p>*I have tried:**</p>
  
  <pre><code>char buffer_length[100];
  
  
      //  assign directly to a string.
  
      sprintf(buffer_length, "%d\n", 234567545);
  
      string sf = buffer_length;
  
  
      cout &lt;&lt;sf.length()-1 &lt;&lt; endl;
  </code></pre>
  
  <p>But there must be a simpler way of doing it or more clean...</p>