integer to bool array
<p>I want to encode the integer like 83 to binary code like 1100101 what is the fastest way to do that? now I'm using this code:</p>

<pre><code>ToBinary(int size, int value) {  
    size--;  
    this-&gt;code = new bool[size];  
    int in = size;  
    while (in &gt;= 0) {  
        if(pow(2, in) &lt;= value) {  
        this-&gt;code[size-in] = pow(2, in);  
        value -= pow(2, in);  
        } else   
            this-&gt;code[size-in] = 0;  
        in--;  
    }  
}
</code></pre>
