When working with Project Euler problems I often need large (> 10**7) bit array\'s.
My normal approach is one of:
bool* sieve = new bool[N]; bool sieve[
For better or for worse, std::vector will use bits instead of bool's, to save space. So just use std::vector like you should have been in the first place.
std::vector
If N is a constant, you can use std::bitset.
N
std::bitset