Library Bitset Type


The standard library makes it easy to deal with bits through the bitset class. To use a bitset we must include its associated header file.
#include <bitset>
using std::bitset;

+++Defining and Initializing bitsets

The bitset class is a class template. When we define a bitset, we say how many bits the bitset will contain, which we do by specifying the size between a pair of angle brackets.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.