i am using "bitset" to convert decimal to binary
like...
int no="192";
cout<<bitset<8>(no);
output:
11000000
i wana pick its second bit which is "1",how can i do that??help:(
Last edited on
1 2 3 4 5 6
|
cout<<bitset<8>(no)[1];
// or
bitset<8> b(no);
cout<< b[1];
|
Last edited on