C++: Binary to Decimal Conversion
<p>I am trying to convert a binary array to decimal in following way: </p>

<pre><code>uint8_t array[8] = {1,1,1,1,0,1,1,1} ;
int decimal = 0 ;    

for(int i = 0 ; i &lt; 8 ; i++)
    decimal = (decimal &lt;&lt; 1) + array[i] ;
</code></pre>

<p>Actually I have to convert 64 bit binary array to decimal and I have to do it for million times.</p>

<p>Can anybody help me, is there any faster way to do the above ? Or is the above one is nice ?</p>
