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

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

$
0
0

so long as you know how many bits the target and source are you can do this.

std::bitset<16> arr("1100110011001100");std::bitset<4> v (    ((arr    ) &      (arr>>4 ) &      (arr>>8 ) &      (arr>>12)).to_ulong() &   0x0f);

Viewing all articles
Browse latest Browse all 4

Trending Articles



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