bitset<4> bs; bs[1] = 1; std::stringstream tempStr; tempStr << bs; string temps = tempStr.str();
debug 结果却是这样, 那个 string 应该是 0100 的,现在却是 0010 了。

bitset<4> bs; bs[1] = 1; std::stringstream tempStr; tempStr << bs; string temps = tempStr.str();
debug 结果却是这样, 那个 string 应该是 0100 的,现在却是 0010 了。
1 codehz Mar 2, 2020 因为 bitset 的 index 是从后往前算的( |
2 codehz Mar 2, 2020 类比数字,个位十位百位是怎么叫的( |
3 amiwrong123 OP @codehz 好吧,原来如此 |