Can I check in C(++) if an array is all 0 (or false)?

后端 未结 8 598
执念已碎
执念已碎 2020-12-21 01:34

Can I check in C(++) if an array is all 0 (or false) without iterating/looping over every single value and without allocating a new array of the same size (to use memc

8条回答
  •  抹茶落季
    2020-12-21 01:53

    Consider using boost::dynamic_bitset instead. It has a none member and several other std::bitset-like operations, but its length can be set at runtime.

提交回复
热议问题