jjzjj

c# - BitArray 以错误的方式返回位?

这段代码:BitArraybits=newBitArray(newbyte[]{7});foreach(boolbitinbits){Console.WriteLine(bit?1:0);}给我以下输出:11100000不应该反过来吗?像这样:00000111我知道有小端和大端,尽管这些术语仅指字节的位置。据我所知,它们不会影响位。 最佳答案 documentationforBitArray状态:Thefirstbyteinthearrayrepresentsbits0through7,thesecondbyterepresents

c++ - 在 C++ 中返回位集 vector

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭6年前。Improvethisquestion我有一个函数返回包含其输入的ASCII值的bitsetvector。typedefbitsetblock;vectorinput_to_binary(strings){vectorv;blockblk;intj=blk.size()-1;for(inti=0;ib(s[i]);for(intk=b.