platform difference?
<p>I was trying out the bitset class in C++ and I tried this with the number 137 as an example:
So, I converted it to binary number which gave me 10001001. Now, I wanted to cut off the MSB and store the rest bits 0001001 in another bit instance called bitarray and I was expecting to see that in the bitarray but it wasn't giving the right value. what could have been the problem? I was just trying to split the MSB from the rest of the bits in the 137 binary representation...here is the code:</p>

<pre><code>bitset&lt;8&gt; bitarray;

bitset&lt;8&gt; bitsetObject(num);
int val = bitsetObject.size();

for (int i = 0; i &lt;= (val - 1); i++)
{
    if (i == 6)
        break;
    else
        bitarray[i] = bitsetObject[i + 1];
}
</code></pre>

<p>If anyone knows how I could easily slice from the second element to the last element in the bitsetObject array, let me know. Thanks..</p>
