Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Answer by Danil Asotsky for C++ Do operation on bits of a std::bitset

One possible solution is:

unsigned long i = arr.to_ulong();i = (i & (i >> 4) & (i >> 8) & (i >> 12)) & 0xf;a = std::bitset<4>(i);

Viewing latest article 1
Browse Latest Browse All 4

Trending Articles