Quantcast
Channel: C++ Do operation on bits of a std::bitset - Stack Overflow
Viewing all articles
Browse latest Browse all 4

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

$
0
0

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 all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>