Which of the following is correct about bitset and vector of bools?

a) Space consumed by bitset is less than vector<bool>
b) Bitset consume only 1 bit per element
c) Number of elements in bitset should be known at compile time whereas vector can have a dynamic size
d) All of the mentioned

1 thought on “Which of the following is correct about bitset and vector of bools?”

  1. d
    Explanation: Bitset consumes less space compared to bool vector however the size for bitset is static whereas for bool vector size is dynamic.

Leave a Comment