I want to extract bits of a decimal number.
For example, 7 is binary 0111, and I want to get 0 1 1 1 all bits stored in bool. How can I do so?
OK, a loop is
Using std::bitset
std::bitset
int value = 123; std::bitset bits(value); std::cout <