質問

Suppose I have a c++ array of bits, ones and zeros, and I want to have it bitwise XORed with an integer number, and get the result as an integer. What is the fastest way to do so?

役に立ちましたか?

解決

Assuming that you mean a std::bitset and assuming that it would fit into an unsigned long, then unsigned long result = your_bits.to_ulong() ^ your_int;

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top