hello,
I am using a bitset constructor to pass an unsigned long and create a bitset object.
bitset<32> bvec(012);
string mystring=bvec.to_string<char,char_traits<char>,allocator<char>
>();
cout << "mystring: " << mystring << endl;
here the least significant 4 bits are- 1010
when i write
bitset<32> bvec(12);
the least significant bits are 1100.
the second case I understand, 1100 is the binary for 12.
How come 012 gives me 1010??
thanks,
bhaskar