Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Java

Idiom #68 Create a bitset

Create an object x to store n bits (n being potentially large).

import java.util.BitSet;
BitSet x = new BitSet(n);

The bitset will be able to grow if needed.
#include <bitset>
std::bitset<n> x;

New implementation...
< >
programming-idioms.org